@@ -262,6 +262,12 @@ attributes (see :ref:`import-mod-attrs` for module attributes):
262262| | | ``yield from ``, or |
263263| | | ``None `` |
264264+-----------------+-------------------+---------------------------+
265+ | | gi_state | state of the generator, |
266+ | | | one of ``GEN_CREATED ``, |
267+ | | | ``GEN_RUNNING ``, |
268+ | | | ``GEN_SUSPENDED ``, or |
269+ | | | ``GEN_CLOSED `` |
270+ +-----------------+-------------------+---------------------------+
265271| async generator | __name__ | name |
266272+-----------------+-------------------+---------------------------+
267273| | __qualname__ | qualified name |
@@ -278,6 +284,13 @@ attributes (see :ref:`import-mod-attrs` for module attributes):
278284+-----------------+-------------------+---------------------------+
279285| | ag_code | code |
280286+-----------------+-------------------+---------------------------+
287+ | | ag_state | state of the async |
288+ | | | generator, one of |
289+ | | | ``AGEN_CREATED ``, |
290+ | | | ``AGEN_RUNNING ``, |
291+ | | | ``AGEN_SUSPENDED ``, or |
292+ | | | ``AGEN_CLOSED `` |
293+ +-----------------+-------------------+---------------------------+
281294| coroutine | __name__ | name |
282295+-----------------+-------------------+---------------------------+
283296| | __qualname__ | qualified name |
@@ -298,6 +311,12 @@ attributes (see :ref:`import-mod-attrs` for module attributes):
298311| | | created, or ``None ``. See |
299312| | | |coroutine-origin-link | |
300313+-----------------+-------------------+---------------------------+
314+ | | cr_state | state of the coroutine, |
315+ | | | one of ``CORO_CREATED ``, |
316+ | | | ``CORO_RUNNING ``, |
317+ | | | ``CORO_SUSPENDED ``, or |
318+ | | | ``CORO_CLOSED `` |
319+ +-----------------+-------------------+---------------------------+
301320| builtin | __doc__ | documentation string |
302321+-----------------+-------------------+---------------------------+
303322| | __name__ | original name of this |
@@ -341,6 +360,11 @@ attributes (see :ref:`import-mod-attrs` for module attributes):
341360
342361 Add ``f_generator `` attribute to frames.
343362
363+ .. versionchanged :: next
364+
365+ Add ``gi_state `` attribute to generators, ``cr_state `` attribute to
366+ coroutines, and ``ag_state `` attribute to async generators.
367+
344368.. function :: getmembers(object[, predicate])
345369
346370 Return all the members of an object in a list of ``(name, value) ``
0 commit comments