8000 Misc cleanups and wording improvements for the itertools docs by rhettinger · Pull Request #119626 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

Misc cleanups and wording improvements for the itertools docs #119626

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 16 commits into from
May 27, 2024
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
Tighter wording for cycle()
  • Loading branch information
rhettinger committed May 27, 2024
commit 61f629dd9d7f9caa9627e9412e273daadf38b866
10 changes: 5 additions & 5 deletions Doc/library/itertools.rst
Original file line number Diff line number Diff line change
Expand Up @@ -347,9 +347,9 @@ loops that truncate the stream.

.. function:: cycle(iterable)

Make an iterator returning elements from the iterable and saving a copy of each.
When the iterable is exhausted, return elements from the saved copy. Repeats
indefinitely. Roughly equivalent to::
Make an iterator returning elements from the *iterable* and saving a
copy of each. When the iterable is exhausted, return elements from
the saved copy. Repeats indefinitely. Roughly equivalent to::

def cycle(iterable):
# cycle('ABCD') → A B C D A B C D A B C D ...
Expand All @@ -361,8 +361,8 @@ loops that truncate the stream.
for element in saved:
yield element

Note, this member of the toolkit may require significant auxiliary storage
(depending on the length of the iterable).
This itertool may require significant auxiliary storage (depending on
the length of the iterable).


.. function:: dropwhile(predicate, iterable)
Expand Down
0