(generator)
Get the mapping of generator local variables to their current values.

    A dict is returned, with the keys the local variable names and values the
    bound values.
Get the mapping of generator local variables to their current values.
Get the mapping of generator local variables to their current values .
def getgeneratorlocals(generator):
    """
    Get the mapping of 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 isgenerator(generator):
        raise TypeError("{!r} is not a Python generator".format(generator))

    frame = getattr(generator, "gi_frame", None)
    if frame is not None:
        return generator.gi_frame.f_locals
    else:
        return {}
def getgeneratorlocals ( generator ) : if not isgenerator ( generator ) : raise TypeError ( "{!r} is not a Python generator" . format ( generator ) ) frame = getattr ( generator , "gi_frame" , None ) if frame is not None : return generator . gi_frame . f_locals else : return { }