(coroutine)
return CORO_SUSPENDED
Get current state of a coroutine object.

    Possible states are:
      CORO_CREATED: Waiting to start execution.
      CORO_RUNNING: Currently being executed by the interpreter.
      CORO_SUSPENDED: Currently suspended at an await expression.
      CORO_CLOSED: Execution has completed.
Get current state of a coroutine object.
Get current state of a coroutine object .
def getcoroutinestate(coroutine):
    """Get current state of a coroutine object.

    Possible states are:
      CORO_CREATED: Waiting to start execution.
      CORO_RUNNING: Currently being executed by the interpreter.
      CORO_SUSPENDED: Currently suspended at an await expression.
      CORO_CLOSED: Execution has completed.
    """
    if coroutine.cr_running:
        return CORO_RUNNING
    if coroutine.cr_frame is None:
        return CORO_CLOSED
    if coroutine.cr_frame.f_lasti == -1:
        return CORO_CREATED
    return CORO_SUSPENDED
def getcoroutinestate ( coroutine ) : if coroutine . cr_running : return CORO_RUNNING if coroutine . cr_frame is None : return CORO_CLOSED if coroutine . cr_frame . f_lasti == - 1 : return CORO_CREATED return CORO_SUSPENDED