Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork32k
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
Uh oh!
There was an error while loading.Please reload this page.
Conversation
python-cla-botbot commentedMay 15, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Doc/reference/compound_stmts.rst Outdated
@@ -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: |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
@skirpichev do i need to fix something? i dont know what being marked as draft is suppose to imply |
There was a problem hiding this 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)
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
…stmt-docs# Conflicts:#Doc/reference/compound_stmts.rst
There was a problem hiding this 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
Uh oh!
There was an error while loading.Please reload this page.
There was a problem hiding this 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.
Doc/reference/compound_stmts.rst Outdated
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. |
There was a problem hiding this comment.
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.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
4eacf38
intopython:mainUh oh!
There was an error while loading.Please reload this page.
Thanks@Yash-Vijay29 for the PR, and@encukou for merging it 🌮🎉.. I'm working now to backport this PR to: 3.14. |
Thank you for the fix! |
GH-134424 is a backport of this pull request to the3.14 branch. |
Uh oh!
There was an error while loading.Please reload this page.
What’s changed
Doc/reference/compound_stmts.rst
, replaced the undefinedstarred_list
token with the actual grammar productionstarred_expression_list
in thefor_stmt
rule.Why
starred_list
is not linked to anything, i believe it was a typo for 'starred_expression_list" that exists inhttps://docs.python.org/3/reference/expressions.html#grammar-token-python-grammar-starred_expression_listBackwards compatibility
Further notes
starred_expression_list
.📚 Documentation preview 📚:https://cpython-previews--134034.org.readthedocs.build/