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: Incorrect repr of InitVar of a type alias
Type: behavior Stage: resolved
Components: Library (Lib) Versions: Python 3.11, Python 3.10, Python 3.9
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: eric.smith, gvanrossum, miss-islington, serhiy.storchaka
Priority: normal Keywords: patch

Created on 2021-10-28 19:46 by serhiy.storchaka, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 29291 merged serhiy.storchaka, 2021-10-28 20:01
PR 29923 merged miss-islington, 2021-12-05 20:42
PR 29924 merged miss-islington, 2021-12-05 20:42
Messages (4)
msg405241 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2021-10-28 19:46
The repr of InitVar preserves type aliases from the typing module, but not builtin.

>>> import typing, dataclasses
>>> dataclasses.InitVar[typing.List[int]]
dataclasses.InitVar[typing.List[int]]
>>> dataclasses.InitVar[list[int]]
dataclasses.InitVar[list]
msg407738 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2021-12-05 20:42
New changeset 1fd4de5bddbbf2a97cdbac4d298c89e1156bdc6c by Serhiy Storchaka in branch 'main':
bpo-45662: Fix the repr of InitVar with a type alias to the built-in class (GH-29291)
https://github.com/python/cpython/commit/1fd4de5bddbbf2a97cdbac4d298c89e1156bdc6c
msg407742 - (view) Author: miss-islington (miss-islington) Date: 2021-12-05 21:02
New changeset f1dd5ed1f35a7ed5c3833c822e9965de2400d77e by Miss Islington (bot) in branch '3.10':
bpo-45662: Fix the repr of InitVar with a type alias to the built-in class (GH-29291)
https://github.com/python/cpython/commit/f1dd5ed1f35a7ed5c3833c822e9965de2400d77e
msg408184 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2021-12-10 09:42
New changeset fb8aad16401e081a6a9059c7b428f7e8aae85d58 by Miss Islington (bot) in branch '3.9':
[3.9] bpo-45662: Fix the repr of InitVar with a type alias to the built-in class (GH-29291) (GH-29924)
https://github.com/python/cpython/commit/fb8aad16401e081a6a9059c7b428f7e8aae85d58
History
Date User Action Args
2022-04-11 14:59:51adminsetgithub: 89825
2021-12-10 09:47:23serhiy.storchakasetstatus: open -> closed
resolution: fixed
stage: patch review -> resolved
2021-12-10 09:42:52serhiy.storchakasetmessages: + msg408184
2021-12-05 21:02:51miss-islingtonsetmessages: + msg407742
2021-12-05 20:42:22miss-islingtonsetpull_requests: + pull_request28148
2021-12-05 20:42:18miss-islingtonsetnosy: + miss-islington
pull_requests: + pull_request28147
2021-12-05 20:42:05serhiy.storchakasetmessages: + msg407738
2021-10-29 08:41:23serhiy.storchakalinkissue45665 dependencies
2021-10-28 20:01:22serhiy.storchakasetkeywords: + patch
stage: patch review
pull_requests: + pull_request27554
2021-10-28 19:46:03serhiy.storchakacreate