Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit dd7c552

Browse files
committed
clarify in/not in in case of infinite iterators; thanks to Sergey Skovorodkin from docs@
1 parent ee0a945 commit dd7c552

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

Doc/howto/functional.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -246,9 +246,9 @@ Built-in functions such as :func:`max` and :func:`min` can take a single
246246
iterator argument and will return the largest or smallest element. The ``"in"``
247247
and ``"not in"`` operators also support iterators: ``X in iterator`` is true if
248248
X is found in the stream returned by the iterator. You'll run into obvious
249-
problems if the iterator is infinite; ``max()``, ``min()``, and ``"not in"``
249+
problems if the iterator is infinite; ``max()``, ``min()``
250250
will never return, and if the element X never appears in the stream, the
251-
``"in"`` operator won't return either.
251+
``"in"`` and ``"not in"`` operators won't return either.
252252

253253
Note that you can only go forward in an iterator; there's no way to get the
254254
previous element, reset the iterator, or make a copy of it. Iterator objects

0 commit comments

Comments
 (0)