[issue42577] Unhelpful syntax error when expression spans multiple lines

Pablo Galindo Salgado report at bugs.python.org
Tue Dec 15 08:05:06 EST 2020


Pablo Galindo Salgado <pablogsal at gmail.com> added the comment:

I concur, handling also multi-line constructs is tricky and I would prefer not to implement some hack for specific situations because my experience is that balancing that with other things Is tricky. As Lysandros mentioned, the parser reports correctly the location of the error as indentation is non important inside parentheses and the code there could be an expression or the begging of a generator.

On the other hand we could think if we have a way of detecting of a syntax error occurs in the context of an unclosed parentheses and maybe do something about it, but I have no idea still how many false negatives could appear.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue42577>
_______________________________________


More information about the Python-bugs-list mailing list