New submission from Pablo Galindo Salgado <[email protected]>:
I have seen this confusion many users over the years. Instead of showing:
❯ python -c '[x,z for x,y in something]'
File "<string>", line 1
[x,z for x,y in something]
^
SyntaxError: invalid syntax
We can show:
❯ ./python -c '[x,z for x,y in something]'
File "<string>", line 1
[x,z for x,y in something]
^
SyntaxError: did you forgot parentheses around the comprehension target?
----------
messages: 385586
nosy: pablogsal
priority: normal
severity: normal
status: open
title: Improve error message in the parser when using un-parenthesised tuples
in comprehensions
_______________________________________
Python tracker <[email protected]>
<https://bugs.python.org/issue43017>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com