clarify in/not in in case of infinite iterators; thanks to Sergey Skovorodkin from docs@

This commit is contained in:
Sandro Tosi 2012-08-15 21:37:19 +02:00
parent c7b8f809e7
commit 4ffe9a0640
1 changed files with 2 additions and 2 deletions

View File

@ -244,9 +244,9 @@ Built-in functions such as :func:`max` and :func:`min` can take a single
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