Skip to content

Commit 6c9aa94

Browse files
picnixzfatelei
andauthored
[3.13] gh-142994, gh-142996: document missing async generator and coroutine field entries in inspect (GH-142997) (#143287)
(cherry picked from commit 0efbad6) Co-authored-by: wangxiaolei <fatelei@gmail.com>
1 parent 7fc3aa5 commit 6c9aa94

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

Doc/library/inspect.rst

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -242,6 +242,9 @@ attributes (see :ref:`import-mod-attrs` for module attributes):
242242
+-----------------+-------------------+---------------------------+
243243
| | ag_running | is the generator running? |
244244
+-----------------+-------------------+---------------------------+
245+
| | ag_suspended | is the generator |
246+
| | | suspended? |
247+
+-----------------+-------------------+---------------------------+
245248
| | ag_code | code |
246249
+-----------------+-------------------+---------------------------+
247250
| coroutine | __name__ | name |
@@ -255,6 +258,9 @@ attributes (see :ref:`import-mod-attrs` for module attributes):
255258
+-----------------+-------------------+---------------------------+
256259
| | cr_running | is the coroutine running? |
257260
+-----------------+-------------------+---------------------------+
261+
| | cr_suspended | is the coroutine |
262+
| | | suspended? |
263+
+-----------------+-------------------+---------------------------+
258264
| | cr_code | code |
259265
+-----------------+-------------------+---------------------------+
260266
| | cr_origin | where coroutine was |
@@ -288,6 +294,19 @@ attributes (see :ref:`import-mod-attrs` for module attributes):
288294

289295
Add ``__builtins__`` attribute to functions.
290296

297+
.. versionchanged:: 3.11
298+
299+
Add ``gi_suspended`` attribute to generators.
300+
301+
.. versionchanged:: 3.11
302+
303+
Add ``cr_suspended`` attribute to coroutines.
304+
305+
.. versionchanged:: 3.12
306+
307+
Add ``ag_suspended`` attribute to async generators.
308+
309+
291310
.. function:: getmembers(object[, predicate])
292311

293312
Return all the members of an object in a list of ``(name, value)``

0 commit comments

Comments
 (0)