Skip to content
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

Misc improvements to the itertools docs #119040

Merged
merged 7 commits into from
May 14, 2024

Conversation

rhettinger
Copy link
Contributor

@rhettinger rhettinger commented May 14, 2024

  • Replace variable it with the spelled-out iterator in the rough code equivalents
  • Use yield from instead of an equivalent for-loop
  • More accurate tee() equivalent that uses only a single shared data store
  • Use contextlib.suppress() instead of equivalent try/except. (Suggested by Pochmann).

📚 Documentation preview 📚: https://cpython-previews--119040.org.readthedocs.build/

@rhettinger rhettinger merged commit 7a97ee5 into python:main May 14, 2024
25 checks passed
@rhettinger rhettinger deleted the further_recipe_cleanups branch May 14, 2024 15:18
@rhettinger rhettinger added needs backport to 3.12 bug and security fixes needs backport to 3.13 bugs and security fixes labels May 14, 2024
@miss-islington-app
Copy link

Thanks @rhettinger for the PR 🌮🎉.. I'm working now to backport this PR to: 3.12.
🐍🍒⛏🤖

@miss-islington-app
Copy link

Thanks @rhettinger for the PR 🌮🎉.. I'm working now to backport this PR to: 3.13.
🐍🍒⛏🤖

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request May 14, 2024
(cherry picked from commit 7a97ee5)

Co-authored-by: Raymond Hettinger <rhettinger@users.noreply.github.com>
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request May 14, 2024
(cherry picked from commit 7a97ee5)

Co-authored-by: Raymond Hettinger <rhettinger@users.noreply.github.com>
@bedevere-app
Copy link

bedevere-app bot commented May 14, 2024

GH-119044 is a backport of this pull request to the 3.12 branch.

@bedevere-app bedevere-app bot removed the needs backport to 3.12 bug and security fixes label May 14, 2024
@bedevere-app
Copy link

bedevere-app bot commented May 14, 2024

GH-119045 is a backport of this pull request to the 3.13 branch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Documentation in the Doc dir skip issue skip news
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant