File tree Expand file tree Collapse file tree 1 file changed +5
-6
lines changed
Expand file tree Collapse file tree 1 file changed +5
-6
lines changed Original file line number Diff line number Diff line change 55Iterator 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
2322To write a loop which iterates over an iterator, the C code should look
2423something like this::
You can’t perform that action at this time.
0 commit comments