Fwd: [BUG] missing ')' causes syntax error on next line

Joe Pfeiffer pfeiffer at cs.nmsu.edu
Wed Jul 22 18:48:21 EDT 2020


Jeff Linahan <jeff.linahan at gmail.com> writes:
>
> See attached image.  Would be nice if it printed "SyntaxError: unbalanced
> parens" as it can difficult to see the problem if code like this is run in
> an environment that only prints the problematic line, which in this case
> the compiler is confused and one line off.

It would be indeed be nice, but it's reporting the error when it finds
it.  Suppose you were typing the program in at the console -- how could
it possibly go back and report the error on the previous line?  Given
python's syntax, does the error even really exist yet on that
previous line?


More information about the Python-list mailing list