Author kj
Recipients gvanrossum, kj, levkivskyi, serhiy.storchaka
Date 2020-11-01.16:00:44
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
@Serhiy, wow interesting find, it seems to be typing's repr problem rather than the actual types itself:

>>> typing.Union[dict[int, str], list[str]]
typing.Union[dict, list]

>>> typing.Union[dict[int, str], list[str]].__args__
(dict[int, str], list[str])

The __args__ seem to be correct, so I'm guessing the typing repr went wrong somewhere. That should be the case for your example too:

>>> alias = typing.List[int] | dict[float, str]
>>> alias
typing.Union[typing.List[int], dict]

>>> type(alias)
<class 'typing._UnionGenericAlias'>

>>> alias.__args__
(typing.List[int], dict[float, str])

I'll work on this. If I don't reply back in a week, someone else is free to take over this issue.
Date User Action Args
2020-11-01 16:00:44kjsetrecipients: + kj, gvanrossum, serhiy.storchaka, levkivskyi
2020-11-01 16:00:44kjsetmessageid: <>
2020-11-01 16:00:44kjlinkissue42233 messages
2020-11-01 16:00:44kjcreate