Staging
v0.5.1
https://github.com/python/cpython
Revision 6c38841c08edd6b0727903ec3f1acd10dc9766f6 authored by Łukasz Langa on 29 June 2020, 22:30:11 UTC, committed by Łukasz Langa on 29 June 2020, 22:30:11 UTC
1 parent dc8ce8e
Raw File
Tip revision: 6c38841c08edd6b0727903ec3f1acd10dc9766f6 authored by Łukasz Langa on 29 June 2020, 22:30:11 UTC
Python 3.8.4rc1
Tip revision: 6c38841
coro.rst
.. highlight:: c

.. _coro-objects:

Coroutine Objects
-----------------

.. versionadded:: 3.5

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


.. c:type:: PyCoroObject

   The C structure used for coroutine objects.


.. c:var:: PyTypeObject PyCoro_Type

   The type object corresponding to coroutine objects.


.. c:function:: int PyCoro_CheckExact(PyObject *ob)

   Return true if *ob*'s type is :c:type:`PyCoro_Type`; *ob* must not be ``NULL``.


.. c:function:: 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__`` set to *name* and *qualname*.
   A reference to *frame* is stolen by this function.  The *frame* argument
   must not be ``NULL``.
back to top