]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.13] gh-142994, gh-142996: document missing async generator and coroutine field...
authorBénédikt Tran <10796600+picnixz@users.noreply.github.com>
Tue, 30 Dec 2025 10:46:44 +0000 (11:46 +0100)
committerGitHub <noreply@github.com>
Tue, 30 Dec 2025 10:46:44 +0000 (10:46 +0000)
(cherry picked from commit 0efbad60e13cbc8b27a5ca3a5d9afcdcc957b19e)

Co-authored-by: wangxiaolei <fatelei@gmail.com>
Doc/library/inspect.rst

index a741223d115da0dbdc6b90c18b11f929d6fd5a8d..c1d2bd848038e27eb6719105c2caafa9cbe3ddef 100644 (file)
@@ -242,6 +242,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                      |
@@ -255,6 +258,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       |
@@ -288,6 +294,19 @@ 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.
+
+
 .. function:: getmembers(object[, predicate])
 
    Return all the members of an object in a list of ``(name, value)``