inspect.getasyncgenlocals
Prev: inspect.getargvalues | Up: inspect | Next: inspect.getasyncgenstate
Rel: inspect.ArgInfo, inspect.Arguments, inspect.Attribute, inspect.BlockFinder
Ref: docs.python.org — inspect.getasyncgenlocals
Tags: #public #python3 #stdlib #inspect
Import
import inspect
from inspect import getasyncgenlocals
Signature & Overview
inspect.getasyncgenlocals(agen)
Get the mapping of asynchronous generator local variables to their current values.
Usage
import inspect
async def agen():
x = 42
yield x
g = agen()
assert inspect.getasyncgenlocals(g) == {}
Gotchas
- Empty before first
anext()and after close: Populated while the async generator is suspended at ayield.
REPL Inspect
from inspect import getasyncgenlocals
help(getasyncgenlocals)
Linked from
Related notes
- tuts/python3/stdlib_module/inspect/getargvalues Linked here; links to this page; shared tags: #inspect, #stdlib
- tuts/python3/stdlib_module/inspect/getasyncgenstate 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