[Python-checkins] cpython (merge 3.3 -> default): merge
raymond.hettinger
python-checkins at python.org
Thu Oct 10 07:43:42 CEST 2013
http://hg.python.org/cpython/rev/98d8551276b4
changeset: 86194:98d8551276b4
parent: 86191:54be46e5110b
parent: 86193:249ba942a6d4
user: Raymond Hettinger <python at rcn.com>
date: Wed Oct 09 22:43:30 2013 -0700
summary:
merge
files:
Doc/c-api/iter.rst | 11 +++++------
1 files changed, 5 insertions(+), 6 deletions(-)
diff --git a/Doc/c-api/iter.rst b/Doc/c-api/iter.rst
--- a/Doc/c-api/iter.rst
+++ b/Doc/c-api/iter.rst
@@ -5,7 +5,7 @@
Iterator Protocol
=================
-There are only a couple of functions specifically for working with iterators.
+There are two functions specifically for working with iterators.
.. c:function:: int PyIter_Check(PyObject *o)
@@ -14,11 +14,10 @@
.. c:function:: PyObject* PyIter_Next(PyObject *o)
- Return the next value from the iteration *o*. If the object is an iterator,
- this retrieves the next value from the iteration, and returns *NULL* with no
- exception set if there are no remaining items. If the object is not an
- iterator, :exc:`TypeError` is raised, or if there is an error in retrieving the
- item, returns *NULL* and passes along the exception.
+ Return the next value from the iteration *o*. The object must be an iterator
+ (it is up to the caller to check this). If there are no remaining values,
+ returns *NULL* with no exception set. If an error occurs while retrieving
+ the item, returns *NULL* and passes along the exception.
To write a loop which iterates over an iterator, the C code should look
something like this::
--
Repository URL: http://hg.python.org/cpython
More information about the Python-checkins
mailing list