bpo-31861: Complete the C-API docs for PyObject_GetAiter and PyAiter_Check (GH-25004)

This commit is contained in:
Pablo Galindo 2021-03-23 23:57:03 +00:00 committed by GitHub
parent a81fca6ec8
commit d9692027f4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 27 additions and 0 deletions

View file

@ -356,3 +356,14 @@ Object Protocol
iterator for the object argument, or the object itself if the object is already
an iterator. Raises :exc:`TypeError` and returns ``NULL`` if the object cannot be
iterated.
.. c:function:: PyObject* PyObject_GetAiter(PyObject *o)
This is the equivalent to the Python expression ``aiter(o)``. Takes an
:class:`AsyncIterable` object and returns an :class:`AsyncIterator` for it.
This is typically a new iterator but if the argument is an
:class:`AsyncIterator`, this returns itself. Raises :exc:`TypeError` and
returns ``NULL`` if the object cannot be iterated.
.. versionadded:: 3.10