Unhelpful SyntaxError
with unclosed call before colon
#94034
Labels
3.10
only security fixes
3.11
only security fixes
3.12
bugs and security fixes
interpreter-core
(Objects, Python, Grammar, and Parser dirs)
type-feature
A feature request or enhancement
Ran into this today. If you forget to close parentheses as part of a call in the header of a
for
,with
, orclass
statement (maybe others too?), theSyntaxError
seems to indicate that you forgot a colon:It's not wrong, but could probably be improved. I personally find the pre-3.10 behavior more helpful:
Even better, though, would be a "smarter" error message like the existing ones we have for unclosed parentheses:
@pablogsal
The text was updated successfully, but these errors were encountered: