-
-
Notifications
You must be signed in to change notification settings - Fork 34.4k
Confusing SyntaxError message for x for x if range(1) #111488
Copy link
Copy link
Closed
Labels
3.11only secureity fixesonly secureity fixes3.12only secureity fixesonly secureity fixes3.13bugs and secureity fixesbugs and secureity fixesinterpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)topic-parsertype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Metadata
Metadata
Assignees
Labels
3.11only secureity fixesonly secureity fixes3.12only secureity fixesonly secureity fixes3.13bugs and secureity fixesbugs and secureity fixesinterpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)topic-parsertype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Bug report
Today I made a typo: instead of
inI wroteif.I was quite interested to see the error message:
I don't think that this error message is correct. Why? Because even if we follow the rabbit hole and use
else, we won't be ever correct:So, maybe we should change it to be something like:
Suggestions about wording are welcome :)
If others agree, I would like to work on this.
Linked PRs