PyDocs

Nav

Python Runtime Services

isgenerator

inspect

function (source)
  • isgenerator(object)
Return true if the object is a generator.

Generator objects provide these attributes:
    gi_code         code object
    gi_frame        frame object or possibly None once the generator has
                    been exhausted
    gi_running      set to 1 when generator is executing, 0 otherwise
    gi_suspended    set to 1 when the generator is suspended at a yield point, 0 otherwise
    gi_yieldfrom    object being iterated by yield from or None

    __iter__()      defined to support iteration over container
    close()         raises a new GeneratorExit exception inside the
                    generator to terminate the iteration
    send()          resumes the generator and "sends" a value that becomes
                    the result of the current yield-expression
    throw()         used to raise an exception inside the generator
0 Examples
No examples for inspect/isgenerator.
See Also
No see-alsos for inspect/isgenerator
0 Notes
No notes for isgenerator