This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Improve mismatching parentheses error
Type: Stage: resolved
Components: Versions:
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: pablogsal
Priority: normal Keywords: patch

Created on 2021-04-11 21:49 by pablogsal, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 25348 closed pablogsal, 2021-04-11 21:56
Messages (2)
msg390798 - (view) Author: Pablo Galindo Salgado (pablogsal) * (Python committer) Date: 2021-04-11 21:49
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
msg391154 - (view) Author: Pablo Galindo Salgado (pablogsal) * (Python committer) Date: 2021-04-15 23:23
This is probably not worth the complexity, so I am closing it
History
Date User Action Args
2022-04-11 14:59:44adminsetgithub: 87975
2021-04-15 23:23:20pablogsalsetstatus: open -> closed
resolution: fixed
stage: patch review -> resolved
2021-04-15 23:23:16pablogsalsetmessages: + msg391154
2021-04-11 21:56:00pablogsalsetkeywords: + patch
stage: patch review
pull_requests: + pull_request24082
2021-04-11 21:49:23pablogsalcreate