mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
bpo-31861: Complete the C-API docs for PyObject_GetAiter and PyAiter_Check (GH-25004)
This commit is contained in:
parent
a81fca6ec8
commit
d9692027f4
5 changed files with 27 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue