[New-bugs-announce] [issue44653] Parameter substitution in the union type does not work with typing.Union

Serhiy Storchaka report at bugs.python.org
Fri Jul 16 09:32:27 EDT 2021


New submission from Serhiy Storchaka <storchaka+cpython at gmail.com>:

>>> import typing
>>> T = typing.TypeVar('T')
>>> (int | T)[typing.Union[str, list]]
NotImplemented

See also issue44633. But in this case the expected result is int | str | list or typing.Union[init, str, list].

----------
components: Interpreter Core
messages: 397624
nosy: gvanrossum, kj, serhiy.storchaka
priority: normal
severity: normal
status: open
title: Parameter substitution in the union type does not work with typing.Union
type: behavior
versions: Python 3.10, Python 3.11

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue44653>
_______________________________________


More information about the New-bugs-announce mailing list