ID EN
Inspect

getgeneratorlocals

Python 3.11

Get the mapping of live local variables in generator to their current values. A dictionary is returned that maps from variable names to values. This is the equivalent of calling locals() in the body of the generator, and all the same caveats apply.

Syntax

PYTHON
inspect.getgeneratorlocals(generator)

See Also

locals() generator TypeError