[New-bugs-announce] [issue43809] Improve mismatching parentheses error

Pablo Galindo Salgado report at bugs.python.org
Sun Apr 11 17:49:23 EDT 2021


New submission from Pablo Galindo Salgado <pablogsal at gmail.com>:

Consider the following program:

( a + b + c ] )

The current error is:

>>> ( a + b + c ] )
  File "<stdin>", line 1
    ( a + b + c ] )
                ^
SyntaxError: closing parenthesis ']' does not match opening parenthesis '('

Which is not bad, but the problem is not that the "(" is not closed (it is) but that the "]" was never opened. An improvement would be:

>>> ( a + b + c ] )
  File "<stdin>", line 1
    ( a + b + c ] )
                ^
SyntaxError: closing parenthesis ']' was never opened

----------
messages: 390798
nosy: pablogsal
priority: normal
severity: normal
status: open
title: Improve mismatching parentheses error

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


More information about the New-bugs-announce mailing list