Text of bugs.python.org › issue47191 as Styx crawled it on Nov 18, 2026. The page may have changed since. Only its words are kept, without pictures or layout.

Open the live page

Issue 47191: inspect - getasyncgeneratorstate, getasyncgeneratorlocals - Python tracker

Python Home About News Documentation Downloads Community Foundation Developer's Guide Issue Tracker Issues Search Random Issue Summaries Issues with patch Easy issues Stats User Administration User List Committer List Help Tracker Documentation Tracker Development Report Tracker Problem Issue47191 ➜ This issue tracker has been migrated to GitHub , and is currently read-only . For more information, see the GitHub FAQs in the Python's Developer Guide.

Created on 2022-04-01 18:40 by animatea.programming , last changed 2022-04-11 14:59 by admin . Messages (2) msg416505 - (view) Author: Animatea Animatea (animatea.programming) Date: 2022-04-01 18:40 Create inspect introspection functions for asyncgen. ```py ASYNCGEN_CREATED = 'ASYNCGEN_CREATED' ASYNCGEN_RUNNING = 'ASYNCGEN_RUNNING' ASYNCGEN_SUSPENDED = 'ASYNCGEN_SUSPENDED' ASYNCGEN_CLOSED = 'ASYNCGEN_CLOSED' def getasyncgeneratorstate(asyncgenerator): """Get current state of a async generator-iterator.

Possible states are: ASYNCGEN_CREATED: Waiting to start execution. ASYNCGEN_RUNNING: Currently being executed by the interpreter. ASYNCGEN_SUSPENDED: Currently suspended at a yield expression. ASYNCGEN_CLOSED: Execution has completed. """ if asyncgenerator.ag_running: return ASYNCGEN_RUNNING if asyncgenerator.ag_frame is None: return ASYNCGEN_CLOSED if asyncgenerator.ag_frame.f_lasti == -1: return ASYNCGEN_CREATED return ASYNCGEN_SUSPENDED def getasyncgeneratorlocals(asyncgenerator): """ Get the mapping of async generator local variables to their current values.

A dict is returned, with the keys the local variable names and values the bound values.""" if not isasyncgen(asyncgenerator): raise TypeError("{!r} is not a Python generator".format(asyncgenerator)) frame = getattr(asyncgenerator, "ag_frame", None) if frame is not None: return asyncgenerator.ag_frame.f_locals else: return {} ``` msg416516 - (view) Author: Karthikeyan Singaravelan (xtreak) * Date: 2022-04-01 20:20 Seems to be duplicate of https://bugs.python.org/issue35759 History Date User Action Args 2022-04-11 14:59:58 admin set github: 91347 2022-04-01 20:20:37 xtreak set nosy: + xtreak messages: + msg416516 2022-04-01 18:40:34 animatea.programming create Supported by The Python Software Foundation , Powered by Roundup Copyright © 1990-2022, Python Software Foundation Legal Statements