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

gh-134026: Fix grammar description of for statement#134034

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
encukou merged 26 commits intopython:mainfromYash-Vijay29:fix-for-stmt-docs
May 21, 2025

Conversation

Yash-Vijay29
Copy link
Contributor

@Yash-Vijay29Yash-Vijay29 commentedMay 15, 2025
edited
Loading

What’s changed

  • InDoc/reference/compound_stmts.rst, replaced the undefinedstarred_list token with the actual grammar productionstarred_expression_list in thefor_stmt rule.

Why

Backwards compatibility

  • This is purely a docs change; there’s no impact on existing code or behavior.

Further notes



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

@python-cla-bot
Copy link

python-cla-botbot commentedMay 15, 2025
edited
Loading

All commit authors signed the Contributor License Agreement.

CLA signed

@@ -151,21 +151,22 @@ The :keyword:`!for` statement
single: : (colon); compound statement

The :keyword:`for` statement is used to iterate over the elements of a sequence
(such as a string, tuple or list) or other iterable object:
(such as a string, tuple, or list) or other iterable object:
Copy link
Member

Choose a reason for hiding this comment

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

Please see warnings on your pr.

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

okay yea saw it. found a "starred_expression_list" in thehttps://docs.python.org/3/reference/expressions.html#grammar-token-python-grammar-starred_expression_list. I will try to link it to that instead then

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

@skirpichev done, i reviewed it locally and doc seems proper. starred_list is turned into starred_expression_list mentioned already inhttps://docs.python.org/3/reference/expressions.html#grammar-token-python-grammar-starred_expression_list

Copy link
Member

Choose a reason for hiding this comment

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

Why this comma? Seems unrelated to the pr content.

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

Why this comma? Seems unrelated to the pr content.

While changing i just noticed a small grammar error and thought of fixing it. Its a small mistake but comma should be there after the tuple, I can make a separate PR for it if you want

Copy link
Member

Choose a reason for hiding this comment

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

@StanFromIreland, does this looks correct for you?

Copy link
Contributor

Choose a reason for hiding this comment

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

It is anoxford comma, its usage is varied across contexts, but generally recommended in formal writing.

It is unrelated to this pr and not very important, I am not against it staying, but I wouldn't be heavily opposed to removing it either.

@skirpichevskirpichev marked this pull request as draftMay 15, 2025 09:39
@Yash-Vijay29
Copy link
ContributorAuthor

@skirpichev do i need to fix something? i dont know what being marked as draft is suppose to imply

@skirpichevskirpichev self-requested a reviewMay 15, 2025 10:23
Copy link
Contributor

@StanFromIrelandStanFromIreland left a comment

Choose a reason for hiding this comment

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

You can mark it as ready for review whenever you feel it is. Currently it is not.

See my comments, and I recommended you read the devguide. (Sections on documentation and pr lifecycle will be particularly handy now)

@Yash-Vijay29Yash-Vijay29 marked this pull request as ready for reviewMay 16, 2025 04:43
@skirpichevskirpichev changed the titlegh-134026: Fix for stmt docsgh-134026: Fix grammar description of for statementMay 18, 2025
@skirpichevskirpichev marked this pull request as ready for reviewMay 18, 2025 08:14
Copy link
Contributor

@StanFromIrelandStanFromIreland left a comment

Choose a reason for hiding this comment

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

Minor change needed otherwise good to go

Copy link
Member

@serhiy-storchakaserhiy-storchaka left a comment

Choose a reason for hiding this comment

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

LGTM, but please fix long lines.

The first item provided
by the iterator is then assigned to the target list using the standard
The :token:`~python-grammar:starred_expression_list` expression is evaluated once;
it should yield an :term:`iterable` object. An :term:`iterator` is created for that iterable.

Choose a reason for hiding this comment

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

If you change this line in any case, please break it between sentences. Otherwise the line is too long. Even if the linter is silent, the recommended size is less than 80 columns.

@encukouencukou added the needs backport to 3.14bugs and security fixes labelMay 21, 2025
@encukouencukou merged commit4eacf38 intopython:mainMay 21, 2025
30 checks passed
@github-project-automationgithub-project-automationbot moved this fromTodo toDone inDocs PRsMay 21, 2025
@miss-islington-app
Copy link

Thanks@Yash-Vijay29 for the PR, and@encukou for merging it 🌮🎉.. I'm working now to backport this PR to: 3.14.
🐍🍒⛏🤖 I'm not a witch! I'm not a witch!

@encukou
Copy link
Member

Thank you for the fix!

miss-islington pushed a commit to miss-islington/cpython that referenced this pull requestMay 21, 2025
…34034)(cherry picked from commit4eacf38)Co-authored-by: Yash Vijay <yash_vijay@outlook.com>
@bedevere-app
Copy link

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

@bedevere-appbedevere-appbot removed the needs backport to 3.14bugs and security fixes labelMay 21, 2025
@Yash-Vijay29Yash-Vijay29 deleted the fix-for-stmt-docs branchMay 21, 2025 15:55
encukou pushed a commit that referenced this pull requestMay 21, 2025
GH-134424)gh-134026: Fix grammar description of for statement (GH-134034)(cherry picked from commit4eacf38)Co-authored-by: Yash Vijay <yash_vijay@outlook.com>
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@serhiy-storchakaserhiy-storchakaserhiy-storchaka left review comments

@encukouencukouencukou approved these changes

@skirpichevskirpichevskirpichev approved these changes

@StanFromIrelandStanFromIrelandStanFromIreland approved these changes

@willingcwillingcAwaiting requested review from willingcwillingc is a code owner

@AA-TurnerAA-TurnerAwaiting requested review from AA-TurnerAA-Turner is a code owner

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

Successfully merging this pull request may close these issues.

5 participants
@Yash-Vijay29@StanFromIreland@encukou@skirpichev@serhiy-storchaka

[8]ページ先頭

©2009-2025 Movatter.jp