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
Syntax errors in else blocks are reported at else #119724
I gave this a go yesterday, but I couldn't come up with something that both fixes this and keeps the current behavior when there's an unmatched else/elif. I'll give another try later and report back.
yeah, the ratio benefit/complexity it's quite important for these error messages and I prefer to have something dummer than showing incorrect things to the user or having to maintain some gigantic rule so it's fine to just not do it
Reacted by Erlend E. Aasland and Lysandros Nikolaou
Activity
[-]Syntax errors in `else` blocks are ignored[/-][+]Syntax errors in `else` blocks are reported at `else`[/+]encukou commentedon May 31, 2024
@lysnikolaou Do you think this can be solved soon?
Beta 2 is coming up; if this can't be fixed quickly it might be better to revert #29513 and try again.
Marking as a potential release blocker.
lysnikolaou commentedon May 31, 2024
I gave this a go yesterday, but I couldn't come up with something that both fixes this and keeps the current behavior when there's an unmatched
else/elif. I'll give another try later and report back.pythongh-119724: Revert "bpo-45759: Better error messages for non-mat…
erlend-aasland commentedon Jun 3, 2024
Would you consider this an improvement?
encukou commentedon Jun 3, 2024
Hard to say with that example. Here is a less minimal one; IMO the error should be “near” the bad line:
erlend-aasland commentedon Jun 3, 2024
In this case, yes it shows the offending line, but not the exact column.
pablogsal commentedon Jun 3, 2024
Yeah, I think the correct thing to do here is reverting
lysnikolaou commentedon Jun 3, 2024
I couldn't make it work well. Let's revert and reevaluate.
pablogsal commentedon Jun 3, 2024
yeah, the ratio benefit/complexity it's quite important for these error messages and I prefer to have something dummer than showing incorrect things to the user or having to maintain some gigantic rule so it's fine to just not do it
gh-119724: Revert "bpo-45759: Better error messages for non-matching …
[3.13] pythongh-119724: Revert "bpo-45759: Better error messages for …
[3.13] pythongh-119724: Revert "bpo-45759: Better error messages for …
[3.13] gh-119724: Revert "bpo-45759: Better error messages for non-ma…
pythongh-119724: Revert "bpo-45759: Better error messages for non-mat…
pythongh-119724: Revert "bpo-45759: Better error messages for non-mat…
pythongh-119724: Revert "bpo-45759: Better error messages for non-mat…