[Python-ideas] Reporting unmatched parentheses in SyntaxError messages?

Chris Angelico rosuav at gmail.com
Wed Jul 8 13:42:03 CEST 2015

On Wed, Jul 8, 2015 at 9:33 PM, Steven D'Aprano <steve at pearwood.info> wrote:
> I believe that this would be a big help to beginners and casual users
> such as sys admins. Experienced programmers have learned the hard way
> that a SyntaxError may mean an unmatched bracket of some kind, but I
> think it would help even experienced coders to be explicit about the
> error.

It's worth noting that this isn't peculiar to Python. *Any* error that
gives a location can potentially have been caused by a
misinterpretation of a previous line. So if it's too hard to say
exactly where the likely problem is, I think it'd still be of value to
suggest looking a line or two above for the actual problem.


More information about the Python-ideas mailing list