diff options
author | Benjamin Peterson <benjamin@python.org> | 2008-07-03 20:28:26 (GMT) |
---|---|---|
committer | Benjamin Peterson <benjamin@python.org> | 2008-07-03 20:28:26 (GMT) |
commit | e7c78b26c63728c0ebe081e2b9a1d9c543d2cc1d (patch) | |
tree | b5bf1915d5bcec9b9a893bce5cfc3a74f737203c /Doc/glossary.rst | |
parent | 69164c77ef963abea3022b3bc03c839cca860d71 (diff) | |
download | cpython-e7c78b26c63728c0ebe081e2b9a1d9c543d2cc1d.zip cpython-e7c78b26c63728c0ebe081e2b9a1d9c543d2cc1d.tar.gz cpython-e7c78b26c63728c0ebe081e2b9a1d9c543d2cc1d.tar.bz2 |
remove traces of .next
Diffstat (limited to 'Doc/glossary.rst')
-rw-r--r-- | Doc/glossary.rst | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/Doc/glossary.rst b/Doc/glossary.rst index 3caa36e..f7a4b569 100644 --- a/Doc/glossary.rst +++ b/Doc/glossary.rst @@ -168,7 +168,7 @@ Glossary :keyword:`yield` elements back to the caller. The function execution is stopped at the :keyword:`yield` keyword (returning the result) and is resumed there when the next element is requested by calling the - :meth:`next` method of the returned iterator. + :meth:`__next__` method of the returned iterator. .. index:: single: generator expression @@ -266,11 +266,12 @@ Glossary iterator An object representing a stream of data. Repeated calls to the iterator's - :meth:`next` method return successive items in the stream. When no more - data is available a :exc:`StopIteration` exception is raised instead. At - this point, the iterator object is exhausted and any further calls to its - :meth:`next` method just raise :exc:`StopIteration` again. Iterators are - required to have an :meth:`__iter__` method that returns the iterator + :meth:`__next__` (or passing it to the builtin function) :func:`next` + method return successive items in the stream. When no more data is + available a :exc:`StopIteration` exception is raised instead. At this + point, the iterator object is exhausted and any further calls to its + :meth:`__next__` method just raise :exc:`StopIteration` again. Iterators + are required to have an :meth:`__iter__` method that returns the iterator object itself so every iterator is also iterable and may be used in most places where other iterables are accepted. One notable exception is code that attempts multiple iteration passes. A container object (such as a |