Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[3.13] Docs: Improve example foritertools.batched() (GH-136775)#136779

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged

Conversation

miss-islington
Copy link
Contributor

@miss-islingtonmiss-islington commentedJul 19, 2025
edited by github-actionsbot
Loading

The current examplebatched('ABCDEFG', n=3) → ABC DEF G can confuse readers because both, the size of the tuples and the number of tuples are 3.
By using a batch size of n=2, it is clearer that then argument refers to the size of the resulting tuples.
I.e. the new example is:batched('ABCDEFG', n=2) → AB CD EF G
(cherry picked from commit3eecc72)

Co-authored-by: RafaelWO38643099+RafaelWO@users.noreply.github.com


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

The current example `batched('ABCDEFG', n=3) → ABC DEF G` can confuse readers because both, the size of the tuples and the number of tuples are 3.By using a batch size of n=2, it is clearer that the `n` argument refers to the size of the resulting tuples.I.e. the new example is: `batched('ABCDEFG', n=2) → AB CD EF G`(cherry picked from commit3eecc72)Co-authored-by: RafaelWO <38643099+RafaelWO@users.noreply.github.com>
@python-cla-bot
Copy link

python-cla-botbot commentedJul 19, 2025
edited
Loading

All commit authors signed the Contributor License Agreement.

CLA signed

@AA-TurnerAA-Turnerenabled auto-merge (squash)July 19, 2025 09:30
@AA-TurnerAA-Turner merged commit96fac51 intopython:3.13Jul 19, 2025
30 of 31 checks passed
@github-project-automationgithub-project-automationbot moved this fromTodo toDone inDocs PRsJul 19, 2025
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@AA-TurnerAA-TurnerAA-Turner approved these changes

@rhettingerrhettingerAwaiting requested review from rhettingerrhettinger is a code owner

Assignees
No one assigned
Labels
docsDocumentation in the Doc dirskip issueskip news
Projects
Status: Done
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

3 participants
@miss-islington@AA-Turner@RafaelWO

[8]ページ先頭

©2009-2025 Movatter.jp