[Python-checkins] cpython (2.7): clarify in/not in in case of infinite iterators; thanks to Sergey Skovorodkin
sandro.tosi
python-checkins at python.org
Wed Aug 15 21:38:31 CEST 2012
http://hg.python.org/cpython/rev/59f520542c1c
changeset: 78598:59f520542c1c
branch: 2.7
user: Sandro Tosi <sandro.tosi at gmail.com>
date: Wed Aug 15 21:37:19 2012 +0200
summary:
clarify in/not in in case of infinite iterators; thanks to Sergey Skovorodkin from docs@
files:
Doc/howto/functional.rst | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/Doc/howto/functional.rst b/Doc/howto/functional.rst
--- a/Doc/howto/functional.rst
+++ b/Doc/howto/functional.rst
@@ -244,9 +244,9 @@
iterator argument and will return the largest or smallest element. The ``"in"``
and ``"not in"`` operators also support iterators: ``X in iterator`` is true if
X is found in the stream returned by the iterator. You'll run into obvious
-problems if the iterator is infinite; ``max()``, ``min()``, and ``"not in"``
+problems if the iterator is infinite; ``max()``, ``min()``
will never return, and if the element X never appears in the stream, the
-``"in"`` operator won't return either.
+``"in"`` and ``"not in"`` operators won't return either.
Note that you can only go forward in an iterator; there's no way to get the
previous element, reset the iterator, or make a copy of it. Iterator objects
--
Repository URL: http://hg.python.org/cpython
More information about the Python-checkins
mailing list