Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork33.7k
Closed
Description
Bug report
Today I made a typo: instead ofin I wroteif.
I was quite interested to see the error message:
>>> [xforxifrange(1)]File"<stdin>",line1 [xforxifrange(1)]^^^^^^^^^^^^^SyntaxError:expected'else'after'if'expression
I don't think that this error message is correct. Why? Because even if we follow the rabbit hole and useelse, we won't be ever correct:
>>> [xfor (xifrange(1)elsey)inrange(1)]File"<stdin>",line1 [xfor (xifrange(1)elsey)inrange(1)]^^^^^^^^^^^^^^^^^^^^SyntaxError:cannotassigntoconditionalexpression
So, maybe we should change it to be something like:
>>> [xforxifrange(1)]File"<stdin>",line1 [xforxifrange(1)]^^SyntaxError:expected'in',got'if'
Suggestions about wording are welcome :)
If others agree, I would like to work on this.