Skip to content

Commit 8ee7708

Browse files
committed
Issue #19005: Fix documentation for PyIter_Next().
1 parent 3415fa3 commit 8ee7708

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

Doc/c-api/iter.rst

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
Iterator Protocol
66
=================
77

8-
There are only a couple of functions specifically for working with iterators.
8+
There are two functions specifically for working with iterators.
99

1010
.. c:function:: int PyIter_Check(PyObject *o)
1111
@@ -14,11 +14,10 @@ There are only a couple of functions specifically for working with iterators.
1414
1515
.. c:function:: PyObject* PyIter_Next(PyObject *o)
1616
17-
Return the next value from the iteration *o*. If the object is an iterator,
18-
this retrieves the next value from the iteration, and returns *NULL* with no
19-
exception set if there are no remaining items. If the object is not an
20-
iterator, :exc:`TypeError` is raised, or if there is an error in retrieving the
21-
item, returns *NULL* and passes along the exception.
17+
Return the next value from the iteration *o*. The object must be an iterator
18+
(it is up to the caller to check this). If there are no remaining values,
19+
returns *NULL* with no exception set. If an error occurs while retrieving
20+
the item, returns *NULL* and passes along the exception.
2221
2322
To write a loop which iterates over an iterator, the C code should look
2423
something like this::

0 commit comments

Comments
 (0)