Skip to content

Disallow lone starred expressions at the *grammar* level #156058

Description

@encukou

Statements like the following (where () can be any iterable -- or at the syntax level, any value):

  • *()
  • x = *()
  • yield *()
  • return *()
  • for _ in *(): ...

are not valid without a comma after the iterable.
These are allowed by python.gram and only rejected in the code generation step. This means that the documented Full Grammar specification is incomplete. We can do better.

Linked PRs

Metadata

Metadata

Assignees

Labels

Projects

Status
Todo

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions