Skip to content

General improvements to the itertools docs #98408

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 15 commits into from
Oct 18, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Remove unnecessary words in tee() docs
  • Loading branch information
rhettinger committed Oct 18, 2022
commit 62f4ff6cf2c80ee70e710b97acb0ba72c07c906c
6 changes: 2 additions & 4 deletions Doc/library/itertools.rst
Original file line number Diff line number Diff line change
Expand Up @@ -681,9 +681,7 @@ loops that truncate the stream.

The following Python code helps explain what *tee* does (although the actual
implementation is more complex and uses only a single underlying
:abbr:`FIFO (first-in, first-out)` queue).

Roughly equivalent to::
:abbr:`FIFO (first-in, first-out)` queue)::

def tee(iterable, n=2):
it = iter(iterable)
Expand All @@ -700,7 +698,7 @@ loops that truncate the stream.
yield mydeque.popleft()
return tuple(gen(d) for d in deques)

Once :func:`tee` has made a split, the original *iterable* should not be
Once :func:`tee` has been created, the original *iterable* should not be
used anywhere else; otherwise, the *iterable* could get advanced without
the tee objects being informed.

Expand Down