Skip to content

Commit d274ffa

Browse files
committed
Document asynchronous generator APIs.
1 parent 4365388 commit d274ffa

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

Doc/c-api/gen.rst

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,3 +49,32 @@ than explicitly calling :c:func:`PyGen_New` or :c:func:`PyGen_NewWithQualName`.
4949
5050
Return a new :term:`strong reference` to the code object wrapped by *gen*.
5151
This function always succeeds.
52+
53+
54+
Asynchronous Generator Objects
55+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
56+
57+
.. seealso::
58+
:pep:`525`
59+
60+
.. c:var:: PyTypeObject PyAsyncGen_Type
61+
62+
The type object corresponding to asynchronous generator objects. This is
63+
available as :class:`types.AsyncGeneratorType` in the Python layer.
64+
65+
.. c:function:: PyObject *PyAsyncGen_New(PyFrameObject *frame, PyObject *name, PyObject *qualname)
66+
67+
Create a new asynchronous generator wrapping *frame*, with ``__name__`` and
68+
``__qualname__`` set to *name* and *qualname*. *frame* is stolen by this
69+
function and must not be ``NULL``.
70+
71+
On success, this function returns a :term:`strong reference` to the
72+
new asynchronous generator. On failure, this function returns ``NULL``
73+
with an exception set.
74+
75+
.. versionadded:: 3.6
76+
77+
.. c:function:: int PyAsyncGen_CheckExact(PyObject *op)
78+
79+
Return true if *op* is an asynchronous generator object, false otherwise.
80+
This function always succeeds.

0 commit comments

Comments
 (0)