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: AST Unparser can't unparse ext slices correctly
Type: behavior Stage: resolved
Components: Interpreter Core Versions: Python 3.9, Python 3.8, Python 3.7
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: BTaskaya, miss-islington, pablogsal
Priority: normal Keywords: patch

Created on 2020-02-01 21:10 by BTaskaya, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 18304 merged BTaskaya, 2020-02-01 21:14
PR 18940 merged miss-islington, 2020-03-11 19:59
PR 18941 merged miss-islington, 2020-03-11 19:59
Messages (4)
msg361193 - (view) Author: Batuhan Taskaya (BTaskaya) * (Python committer) Date: 2020-02-01 21:10
(this issue has already a PR for ast.unparse)

>>> from __future__ import annotations
>>> import ast
>>> x: Tuple[1:2,] = 3
>>> __annotations__["x"]
'Tuple[1:2]'
>>> ast.dump(ast.parse("Tuple[1:2,]"))
"Module(body=[Expr(value=Subscript(value=Name(id='Tuple', ctx=Load()), slice=ExtSlice(dims=[Slice(lower=Constant(value=1, kind=None), upper=Constant(value=2, kind=None), step=None)]), ctx=Load()))], type_ignores=[])"

>>> ast.dump(ast.parse("Tuple[1:2]"))
"Module(body=[Expr(value=Subscript(value=Name(id='Tuple', ctx=Load()), slice=Slice(lower=Constant(value=1, kind=None), upper=Constant(value=2, kind=None), step=None), ctx=Load()))], type_ignores=[])"
msg363086 - (view) Author: Pablo Galindo Salgado (pablogsal) * (Python committer) Date: 2020-03-01 20:07
New changeset 185903de12de8837bf0dc0008a16e5e56c66a019 by Batuhan Taşkaya in branch 'master':
bpo-39520: Fix un-parsing of ext slices with no dimensions (GH-18304)
https://github.com/python/cpython/commit/185903de12de8837bf0dc0008a16e5e56c66a019
msg363962 - (view) Author: miss-islington (miss-islington) Date: 2020-03-11 20:16
New changeset d0837d2af2c23c3a4b6274f76ca6422a427cc438 by Miss Islington (bot) in branch '3.7':
bpo-39520: Fix un-parsing of ext slices with no dimensions (GH-18304)
https://github.com/python/cpython/commit/d0837d2af2c23c3a4b6274f76ca6422a427cc438
msg363963 - (view) Author: miss-islington (miss-islington) Date: 2020-03-11 20:18
New changeset cd07b4da659cb5e86fe7c856aca866b9db466fce by Miss Islington (bot) in branch '3.8':
bpo-39520: Fix un-parsing of ext slices with no dimensions (GH-18304)
https://github.com/python/cpython/commit/cd07b4da659cb5e86fe7c856aca866b9db466fce
History
Date User Action Args
2022-04-11 14:59:26adminsetgithub: 83701
2020-03-11 20:18:04miss-islingtonsetmessages: + msg363963
2020-03-11 20:16:42miss-islingtonsetmessages: + msg363962
2020-03-11 19:59:43miss-islingtonsetpull_requests: + pull_request18294
2020-03-11 19:59:37miss-islingtonsetnosy: + miss-islington

pull_requests: + pull_request18293
2020-03-04 19:45:25BTaskayasetstatus: open -> closed
resolution: fixed
stage: patch review -> resolved
2020-03-01 20:07:26pablogsalsetnosy: + pablogsal
messages: + msg363086
2020-02-01 21:14:04BTaskayasetkeywords: + patch
stage: patch review
pull_requests: + pull_request17681
2020-02-01 21:10:07BTaskayacreate