diff options
author | Georg Brandl <georg@python.org> | 2008-04-30 20:06:53 (GMT) |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2008-04-30 20:06:53 (GMT) |
commit | f392057eb126bc22e2b99af8f39c11ea13331720 (patch) | |
tree | 3f970ed2911cdf6519861adacaa84b9e37ae7f35 /Doc | |
parent | c71520eba7ff55c93ad5c4bc8d1a0abefa1bff9d (diff) | |
download | cpython-f392057eb126bc22e2b99af8f39c11ea13331720.zip cpython-f392057eb126bc22e2b99af8f39c11ea13331720.tar.gz cpython-f392057eb126bc22e2b99af8f39c11ea13331720.tar.bz2 |
Merged revisions 62602 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r62602 | georg.brandl | 2008-04-30 22:02:37 +0200 (Wed, 30 Apr 2008) | 2 lines
#2727: clarify tp_iternext docs.
........
Diffstat (limited to 'Doc')
-rw-r--r-- | Doc/c-api/typeobj.rst | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/Doc/c-api/typeobj.rst b/Doc/c-api/typeobj.rst index 83bef7d..6b7c4ac 100644 --- a/Doc/c-api/typeobj.rst +++ b/Doc/c-api/typeobj.rst @@ -739,9 +739,11 @@ set. .. cmember:: iternextfunc PyTypeObject.tp_iternext - An optional pointer to a function that returns the next item in an iterator, or - raises :exc:`StopIteration` when the iterator is exhausted. Its presence - normally signals that the instances of this type are iterators. + An optional pointer to a function that returns the next item in an iterator. + When the iterator is exhausted, it must return *NULL*; a :exc:`StopIteration` + exception may or may not be set. When another error occurs, it must return + *NULL* too. Its presence signals that the instances of this type are + iterators. Iterator types should also define the :attr:`tp_iter` function, and that function should return the iterator instance itself (not a new iterator |