Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork33.3k
gh-129515: Clarify syntax error messages for conditional expressions#129880
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
gh-129515: Clarify syntax error messages for conditional expressions#129880
Uh oh!
There was an error while loading.Please reload this page.
Conversation
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
test_fstring fails, will dig |
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
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.
Left some new comments
A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated. Once you have made the requested changes, please leave a comment on this pull request containing the phrase |
- also reword error messages- move tests to test_syntax- update whatsnew and news
I have made the requested changes; please review again |
Thanks for making the requested changes! @pablogsal: please review the changes made to this pull request. |
Uh oh!
There was an error while loading.Please reload this page.
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
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.
Ah, this looks MUCH better. Really well done@sergey-miryanov! 👍
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Misc/NEWS.d/next/Core_and_Builtins/2025-02-09-11-30-38.gh-issue-129515.3L3vmo.rst OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
…e-129515.3L3vmo.rstCo-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
…y-miryanov/cpython intopythongh-129515-ifexp-syntax-error
Thank you all for your review! I made the suggested changes, and it is ready now. |
bcc9a5d intopython:mainUh oh!
There was an error while loading.Please reload this page.
Excellent job@sergey-miryanov! Thanks for your contribution 👌 |
Thanks! |
Uh oh!
There was an error while loading.Please reload this page.
Along the suggestion from the original issue, I have added the following rules and messages:
The following expressions will be handled by
a=disjunction 'if' b=disjunction 'else' c=invalid_ifexp_orelse_stmtand generate the message "Syntax Error: statement given where 'orelse' expression required" instead of just "Syntax Error: invalid syntax":The following expressions will be handled by
a=invalid_ifexp_body_stmt 'if' b=disjunction 'else' c=expressionand generate the message "Syntax Error: statement given where 'body' expression required":The followingexpressions will be handled by
a=invalid_ifexp_body_stmt 'if' b=disjunction 'else' c=invalid_ifexp_orelse_stmtand generate the message "Syntax Error: statement given where 'body' expression required":