Skip to content

Commit 0efbad6

Browse files
authored
gh-142994, gh-142996: document missing async generator and coroutine field entries in inspect (#142997)
1 parent fa9a425 commit 0efbad6

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

Doc/library/inspect.rst

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -273,6 +273,9 @@ attributes (see :ref:`import-mod-attrs` for module attributes):
273273
+-----------------+-------------------+---------------------------+
274274
| | ag_running | is the generator running? |
275275
+-----------------+-------------------+---------------------------+
276+
| | ag_suspended | is the generator |
277+
| | | suspended? |
278+
+-----------------+-------------------+---------------------------+
276279
| | ag_code | code |
277280
+-----------------+-------------------+---------------------------+
278281
| coroutine | __name__ | name |
@@ -286,6 +289,9 @@ attributes (see :ref:`import-mod-attrs` for module attributes):
286289
+-----------------+-------------------+---------------------------+
287290
| | cr_running | is the coroutine running? |
288291
+-----------------+-------------------+---------------------------+
292+
| | cr_suspended | is the coroutine |
293+
| | | suspended? |
294+
+-----------------+-------------------+---------------------------+
289295
| | cr_code | code |
290296
+-----------------+-------------------+---------------------------+
291297
| | cr_origin | where coroutine was |
@@ -319,6 +325,18 @@ attributes (see :ref:`import-mod-attrs` for module attributes):
319325

320326
Add ``__builtins__`` attribute to functions.
321327

328+
.. versionchanged:: 3.11
329+
330+
Add ``gi_suspended`` attribute to generators.
331+
332+
.. versionchanged:: 3.11
333+
334+
Add ``cr_suspended`` attribute to coroutines.
335+
336+
.. versionchanged:: 3.12
337+
338+
Add ``ag_suspended`` attribute to async generators.
339+
322340
.. versionchanged:: 3.14
323341

324342
Add ``f_generator`` attribute to frames.

0 commit comments

Comments
 (0)