Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork32k
Description
Documentation
In thecompound statements docs, section 8.3 i found:
for_stmt ::= "for"target_list "in" starred_list ":"suite
["else" ":"suite]
However, starred_list does not appear to be a defined production rule elsewhere in the language reference. It seems to act more like a semantic placeholder to indicate that starred_expressions (like *x) are allowed in the iterable.
Since the real grammar uses expression_list — which already includes starred_expression — would it be more consistent and accurate to write this instead?:
for_stmt ::= "for" target_list "in" expression_list ":" suite
["else" ":" suite]
…and then note in the accompanying text that starred_expression is supported?
This might reduce confusion for readers trying to understand or implement the formal grammar.
Can I work on that?
Linked PRs
Metadata
Metadata
Assignees
Projects
Status