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.

Author serhiy.storchaka
Recipients gvanrossum, kj, serhiy.storchaka
Date 2021-07-14.11:04:41
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1626260682.01.0.97762085111.issue44636@roundup.psfhosted.org>
In-reply-to
Content
typing.Union always collapsed to a simple type if it contains a single type.

>>> import typing
>>> typing.Union[int, typing.T][int]
<class 'int'>

But the builtin union type can contain a single type:

>>> (int | typing.T)[int]
int
>>> type((int | typing.T)[int])
<class 'types.Union'>
History
Date User Action Args
2021-07-14 11:04:42serhiy.storchakasetrecipients: + serhiy.storchaka, gvanrossum, kj
2021-07-14 11:04:42serhiy.storchakasetmessageid: <1626260682.01.0.97762085111.issue44636@roundup.psfhosted.org>
2021-07-14 11:04:42serhiy.storchakalinkissue44636 messages
2021-07-14 11:04:41serhiy.storchakacreate