Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit f392057

Browse files
committed
Merged revisions 62602 via svnmerge from
svn+ssh://[email protected]/python/trunk ........ r62602 | georg.brandl | 2008-04-30 22:02:37 +0200 (Wed, 30 Apr 2008) | 2 lines #2727: clarify tp_iternext docs. ........
1 parent c71520e commit f392057

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

Doc/c-api/typeobj.rst

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -739,9 +739,11 @@ set.
739739

740740
.. cmember:: iternextfunc PyTypeObject.tp_iternext
741741

742-
An optional pointer to a function that returns the next item in an iterator, or
743-
raises :exc:`StopIteration` when the iterator is exhausted. Its presence
744-
normally signals that the instances of this type are iterators.
742+
An optional pointer to a function that returns the next item in an iterator.
743+
When the iterator is exhausted, it must return *NULL*; a :exc:`StopIteration`
744+
exception may or may not be set. When another error occurs, it must return
745+
*NULL* too. Its presence signals that the instances of this type are
746+
iterators.
745747

746748
Iterator types should also define the :attr:`tp_iter` function, and that
747749
function should return the iterator instance itself (not a new iterator

0 commit comments

Comments
 (0)