Commit ab425aa9 authored by Raymond Hettinger's avatar Raymond Hettinger

Issue #16394: Note the tee() pure python equivalent is only a rough approximation.

parent cd9b5c2f
...@@ -588,7 +588,10 @@ loops that truncate the stream. ...@@ -588,7 +588,10 @@ loops that truncate the stream.
.. function:: tee(iterable, n=2) .. function:: tee(iterable, n=2)
Return *n* independent iterators from a single iterable. Equivalent to:: Return *n* independent iterators from a single iterable.
The following Python code helps explain what *tee* does (although the actual
implementation is more complex and uses only a single underlying FIFO queue)::
def tee(iterable, n=2): def tee(iterable, n=2):
it = iter(iterable) it = iter(iterable)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment