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: Pegen: cover extra surrounding parentheses for invalid annotated assignment
Type: Stage: resolved
Components: Versions: Python 3.10, Python 3.9
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: BTaskaya, gvanrossum, lys.nikolaou, pablogsal
Priority: normal Keywords: patch

Created on 2020-05-25 15:02 by BTaskaya, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 20387 merged BTaskaya, 2020-05-25 15:07
PR 21186 merged pablogsal, 2020-06-27 18:41
Messages (3)
msg369885 - (view) Author: Batuhan Taskaya (BTaskaya) * (Python committer) Date: 2020-05-25 15:02
$ python -X oldparser
Python 3.10.0a0 (heads/bpo-xxxxx:f2947e354c, May 21 2020, 18:54:57) 
[GCC 9.2.1 20191008] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> (()): int
  File "<stdin>", line 1
SyntaxError: only single target (not tuple) can be annotated
>>> ((())): int
  File "<stdin>", line 1
SyntaxError: only single target (not tuple) can be annotated
>>> (((()))): int
  File "<stdin>", line 1
SyntaxError: only single target (not tuple) can be annotated
>>> ([]): int
  File "<stdin>", line 1
SyntaxError: only single target (not list) can be annotated
>>> (([])): int
  File "<stdin>", line 1
SyntaxError: only single target (not list) can be annotated

---- current ----

>>> (()): int
  File "<stdin>", line 1
    (()): int
     ^
SyntaxError: illegal target for annotation
>>> (((()))): int
  File "<stdin>", line 1
    (((()))): int
       ^
SyntaxError: illegal target for annotation
>>> ([]): int
  File "<stdin>", line 1
    ([]): int
     ^
SyntaxError: illegal target for annotation
>>> (([])): int
  File "<stdin>", line 1
    (([])): int
      ^
SyntaxError: illegal target for annotation
msg372473 - (view) Author: Pablo Galindo Salgado (pablogsal) * (Python committer) Date: 2020-06-27 18:33
New changeset c8f29ad986f8274fc5fbf889bdd2a211878856b9 by Batuhan Taskaya in branch 'master':
bpo-40769: Allow extra surrounding parentheses for invalid annotated assignment rule (GH-20387)
https://github.com/python/cpython/commit/c8f29ad986f8274fc5fbf889bdd2a211878856b9
msg372480 - (view) Author: Pablo Galindo Salgado (pablogsal) * (Python committer) Date: 2020-06-27 23:40
New changeset 102ca529ef5d45b9ef70a341705ddf2577914135 by Pablo Galindo in branch '3.9':
[3.9] bpo-40769: Allow extra surrounding parentheses for invalid annotated assignment rule (GH-20387) (GH-21186)
https://github.com/python/cpython/commit/102ca529ef5d45b9ef70a341705ddf2577914135
History
Date User Action Args
2022-04-11 14:59:31adminsetgithub: 84946
2020-06-27 23:41:01pablogsalsetstatus: open -> closed
resolution: fixed
stage: patch review -> resolved
2020-06-27 23:40:49pablogsalsetmessages: + msg372480
2020-06-27 18:41:14pablogsalsetpull_requests: + pull_request20341
2020-06-27 18:33:12pablogsalsetmessages: + msg372473
2020-05-25 15:08:54BTaskayasetnosy: + gvanrossum, lys.nikolaou, pablogsal
2020-05-25 15:07:19BTaskayasetkeywords: + patch
stage: patch review
pull_requests: + pull_request19650
2020-05-25 15:03:06BTaskayasetversions: + Python 3.9, Python 3.10
2020-05-25 15:02:59BTaskayacreate