You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Improve error messages for non-matching elif/else statements #89920
I'd like to expand this to more than just elif/else statements inside if` statement blocks and make an error for other cases as well. I currently have a PR that has a general error to accommodate those cases.
changed the title [-]`elif` inside `if` block is a `SyntaxError`[/-][+]non-matching `elif`/`else` statements with uninformative errors[/+]on Nov 9, 2021
changed the title [-]non-matching `elif`/`else` statements with uninformative errors[/-][+]Improve error messages for non-matching `elif`/`else` statements[/+]on Nov 9, 2021
Activity
thatbirdguythatuknownot commentedon Nov 8, 2021
While fixing errors in a program, I encountered this:
It should be giving an
IndentationErroror a better error message at least.thatbirdguythatuknownot commentedon Nov 9, 2021
I'd like to expand this to more than just
elif/else statements insideif` statement blocks and make an error for other cases as well. I currently have a PR that has a general error to accommodate those cases.[-]`elif` inside `if` block is a `SyntaxError`[/-][+]non-matching `elif`/`else` statements with uninformative errors[/+][-]non-matching `elif`/`else` statements with uninformative errors[/-][+]Improve error messages for non-matching `elif`/`else` statements[/+]iritkatriel commentedon Apr 4, 2023
CC @pablogsal .
erlend-aasland commentedon Jan 5, 2024
ISTM that error messages was improved in #29513. Can we close this as completed, or is there remaining actionable items?
lysnikolaou commentedon Jan 5, 2024
I think we can close this, yes.
encukou commentedon Jun 3, 2024
This introduced a regression; it might need to be reverted for 3.13.0b2. See #119724
encukou commentedon Jun 4, 2024
The commit was reverted. Re-opening in case someone wants to take another stab at this.