inspect.getasyncgenstate
Prev: inspect.getasyncgenlocals | Up: inspect | Next: inspect.getattr_static
Rel: inspect.ArgInfo, inspect.Arguments, inspect.Attribute, inspect.BlockFinder
Ref: docs.python.org — inspect.getasyncgenstate
Tags: #public #python3 #stdlib #inspect
Import
import inspect
from inspect import getasyncgenstate
Signature & Overview
inspect.getasyncgenstate(agen)
Get current state of an asynchronous generator object.
Usage
import inspect
async def agen():
yield 1
g = agen()
assert inspect.getasyncgenstate(g) == inspect.AGEN_CREATED
Gotchas
- States:
AGEN_CREATED,AGEN_RUNNING,AGEN_SUSPENDED,AGEN_CLOSED.
REPL Inspect
from inspect import getasyncgenstate
help(getasyncgenstate)
Linked from
Related notes
- tuts/python3/stdlib_module/inspect/getasyncgenlocals Linked here; links to this page; shared tags: #inspect, #stdlib
- tuts/python3/stdlib_module/inspect/getattr_static Linked here; links to this page; shared tags: #inspect, #stdlib
- tuts/python3/stdlib_module/inspect Linked here; links to this page; shared tags: #stdlib
- tuts/python3/stdlib_module/inspect/ArgInfo Linked here; shared tags: #inspect, #stdlib
- tuts/python3/stdlib_module/inspect/Arguments Linked here; shared tags: #inspect, #stdlib
- tuts/python3/stdlib_module/inspect/Attribute Linked here; shared tags: #inspect, #stdlib
- tuts/python3/stdlib_module/inspect/BlockFinder Linked here; shared tags: #inspect, #stdlib
- tuts/python3/stdlib_module/inspect/BoundArguments shared tags: #inspect, #stdlib
- tuts/python3/stdlib_module/inspect/BufferFlags shared tags: #inspect, #stdlib
- tuts/python3/stdlib_module/inspect/ClassFoundException shared tags: #inspect, #stdlib