From 44841574ad7621d8709559b3e4c1a9c599e9b469 Mon Sep 17 00:00:00 2001 From: "Miss Islington (bot)" <31488909+miss-islington@users.noreply.github.com> Date: Sun, 28 Dec 2025 19:09:00 +0100 Subject: [PATCH] [3.14] gh-142994, gh-142996: document missing async generator and coroutine field entries in `inspect` (GH-142997) (#143258) gh-142994, gh-142996: document missing async generator and coroutine field entries in `inspect` (GH-142997) (cherry picked from commit 0efbad60e13cbc8b27a5ca3a5d9afcdcc957b19e) Co-authored-by: wangxiaolei --- Doc/library/inspect.rst | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/Doc/library/inspect.rst b/Doc/library/inspect.rst index c5af7d5de283..27043c90ea2f 100644 --- a/Doc/library/inspect.rst +++ b/Doc/library/inspect.rst @@ -273,6 +273,9 @@ attributes (see :ref:`import-mod-attrs` for module attributes): +-----------------+-------------------+---------------------------+ | | ag_running | is the generator running? | +-----------------+-------------------+---------------------------+ +| | ag_suspended | is the generator | +| | | suspended? | ++-----------------+-------------------+---------------------------+ | | ag_code | code | +-----------------+-------------------+---------------------------+ | coroutine | __name__ | name | @@ -286,6 +289,9 @@ attributes (see :ref:`import-mod-attrs` for module attributes): +-----------------+-------------------+---------------------------+ | | cr_running | is the coroutine running? | +-----------------+-------------------+---------------------------+ +| | cr_suspended | is the coroutine | +| | | suspended? | ++-----------------+-------------------+---------------------------+ | | cr_code | code | +-----------------+-------------------+---------------------------+ | | cr_origin | where coroutine was | @@ -319,6 +325,18 @@ attributes (see :ref:`import-mod-attrs` for module attributes): Add ``__builtins__`` attribute to functions. +.. versionchanged:: 3.11 + + Add ``gi_suspended`` attribute to generators. + +.. versionchanged:: 3.11 + + Add ``cr_suspended`` attribute to coroutines. + +.. versionchanged:: 3.12 + + Add ``ag_suspended`` attribute to async generators. + .. versionchanged:: 3.14 Add ``f_generator`` attribute to frames. -- 2.47.3