Ken Jin <kenjin4...@gmail.com> added the comment:

@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.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue42233>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to