You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
GeeTransitmannequin opened this issue
Aug 6, 2019
· 3 comments
Labels
3.11only security fixes3.12bugs and security fixes3.13bugs and security fixesstdlibPython modules in the Lib dirtype-bugAn unexpected behavior, bug, or error
In PEP-525, async generators were introduced. They use .asend() and .athrow() methods that return a "coroutine-like" object - specifically, a PyAsyncGenASend and PyAsyncGenAThrow respectively.
While these "coroutine-like" object implement .send(), .throw(), and .close(), they don't provide any attributes like normal coroutine objects do such as cr_running or cr_await.
When I use inspect.getcoroutinestate(), it raises an AttributeError on how there isn't a cr_running attribute / flag.
There is a workaround I use which is to wrap it with another coroutine as below:
this thread is about inspecting the state of an agen.asend(...) "coroutine-like" object (i.e. PyAsyncGenASend, AKA async_generator_asend on CPython). AFAICT it is still not possible to inspect the state of a PyAsyncGenASend unless you wrap it.
3.11only security fixes3.12bugs and security fixes3.13bugs and security fixesstdlibPython modules in the Lib dirtype-bugAn unexpected behavior, bug, or error
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: