-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
PEP 679: Modify proposal and improve sections #4575
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
peps/pep-0679.rst
Outdated
assert_stmt ::= "assert" expression [',' expression] | ||
| "assert" '(' expression [',' expression] [','] ')' |
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.
Doesn't the parenthesized version need to go first?
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.
I need to redo this section to adapt to the PEG parser
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.
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 |
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.
The specification now calls for a grammar change, so “Implementing in the compiler” can go to Rejected ideas.
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.
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.
PEP 123: Summary of changes
)📚 Documentation preview 📚: https://pep-previews--4575.org.readthedocs.build/