协程对象

3.5 版新增。

Coroutine objects are what functions declared with an async keyword return.

PyCoroObject

The C structure used for coroutine objects.

PyTypeObject PyCoro_Type

The type object corresponding to coroutine objects.

int PyCoro_CheckExact ( PyObject *ob )

返回 True 若 ob ’s type is PyCoro_Type ; ob 必须不是 NULL . This function always succeeds.

PyObject * PyCoro_New ( PyFrameObject *frame , PyObject *name , PyObject *qualname )
返回值:新引用。

Create and return a new coroutine object based on the frame object, with __name__ and __qualname__ 设为 name and qualname . A reference to frame is stolen by this function. The frame argument must not be NULL .

上一话题

生成器对象

下一话题

Context Variables Objects

本页