Skip to content

Conversation

StanFromIreland
Copy link
Member

@StanFromIreland StanFromIreland commented Sep 4, 2025

  • Change is either:
    • To a Draft PEP
    • To an Accepted or Final PEP, with Steering Council approval
    • To fix an editorial issue (markup, typo, link, header, etc)
  • PR title prefixed with PEP number (e.g. PEP 123: Summary of changes)

📚 Documentation preview 📚: https://pep-previews--4575.org.readthedocs.build/

Comment on lines 104 to 105
assert_stmt ::= "assert" expression [',' expression]
| "assert" '(' expression [',' expression] [','] ')'
Copy link
Member

Choose a reason for hiding this comment

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

Doesn't the parenthesized version need to go first?

Copy link
Member

Choose a reason for hiding this comment

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

I need to redo this section to adapt to the PEG parser

Copy link
Member Author

Choose a reason for hiding this comment

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

I made some changes in the last commit.

parentheses. The lookahead is needed so statements like ``assert (a, b) <= c,
"something"`` are still parsed correctly and to prevent the parser to eagerly
capture the tuple as the full statement.
Implementation Notes
Copy link
Member

Choose a reason for hiding this comment

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

The specification now calls for a grammar change, so “Implementing in the compiler” can go to Rejected ideas.

Copy link
Member Author

Choose a reason for hiding this comment

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

I think it is not, the compiler section notes that in 3.18 (no more warning), using the specified grammar,

the implementation can be moved to the parser level

Giving us the proper AST.

@StanFromIreland StanFromIreland marked this pull request as ready for review September 5, 2025 14:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants