(generator)
return GEN_SUSPENDED
Get current state of a generator-iterator.

    Possible states are:
      GEN_CREATED: Waiting to start execution.
      GEN_RUNNING: Currently being executed by the interpreter.
      GEN_SUSPENDED: Currently suspended at a yield expression.
      GEN_CLOSED: Execution has completed.
Get current state of a generator-iterator.
Get current state of a generator - iterator .
def getgeneratorstate(generator):
    """Get current state of a generator-iterator.

    Possible states are:
      GEN_CREATED: Waiting to start execution.
      GEN_RUNNING: Currently being executed by the interpreter.
      GEN_SUSPENDED: Currently suspended at a yield expression.
      GEN_CLOSED: Execution has completed.
    """
    if generator.gi_running:
        return GEN_RUNNING
    if generator.gi_frame is None:
        return GEN_CLOSED
    if generator.gi_frame.f_lasti == -1:
        return GEN_CREATED
    return GEN_SUSPENDED
def getgeneratorstate ( generator ) : if generator . gi_running : return GEN_RUNNING if generator . gi_frame is None : return GEN_CLOSED if generator . gi_frame . f_lasti == - 1 : return GEN_CREATED return GEN_SUSPENDED