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

Docs: Improve example foritertools.batched()#136775

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

Conversation

RafaelWO
Copy link
Contributor

@RafaelWORafaelWO 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


📚 Documentation preview 📚:https://cpython-previews--136775.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`
@python-cla-bot
Copy link

python-cla-botbot commentedJul 19, 2025
edited
Loading

All commit authors signed the Contributor License Agreement.

CLA signed

@RafaelWO
Copy link
ContributorAuthor

@AA-Turner, thanks for the review! 🙂

Copy link
Member

@AA-TurnerAA-Turner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Thank you!

A

@AA-TurnerAA-Turner changed the titleDocs: Improve example ofitertools.batchedDocs: Improve example foritertools.batched()Jul 19, 2025
@AA-TurnerAA-Turner added needs backport to 3.13bugs and security fixes needs backport to 3.14bugs and security fixes labelsJul 19, 2025
@AA-TurnerAA-Turner merged commit3eecc72 intopython:mainJul 19, 2025
43 checks passed
@miss-islington-app
Copy link

Thanks@RafaelWO for the PR, and@AA-Turner for merging it 🌮🎉.. I'm working now to backport this PR to: 3.13, 3.14.
🐍🍒⛏🤖

@github-project-automationgithub-project-automationbot moved this fromTodo toDone inDocs PRsJul 19, 2025
miss-islington pushed a commit to miss-islington/cpython that referenced this pull requestJul 19, 2025
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 commit 3eecc72ac70943f7e33297eea17803af15322c88)Co-authored-by: RafaelWO <38643099+RafaelWO@users.noreply.github.com>
miss-islington pushed a commit to miss-islington/cpython that referenced this pull requestJul 19, 2025
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>
@bedevere-app
Copy link

GH-136778 is a backport of this pull request to the3.14 branch.

@bedevere-appbedevere-appbot removed the needs backport to 3.14bugs and security fixes labelJul 19, 2025
@bedevere-app
Copy link

GH-136779 is a backport of this pull request to the3.13 branch.

@bedevere-appbedevere-appbot removed the needs backport to 3.13bugs and security fixes labelJul 19, 2025
AA-Turner pushed a commit that referenced this pull requestJul 19, 2025
…136779)Docs: Improve example for ``itertools.batched()`` (GH-136775)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>
AA-Turner pushed a commit that referenced this pull requestJul 19, 2025
…136778)Docs: Improve example for ``itertools.batched()`` (GH-136775)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>
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 newssprint
Projects
Status: Done
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

3 participants
@RafaelWO@AA-Turner@skirpichev

[8]ページ先頭

©2009-2025 Movatter.jp