New submission from Serhiy Storchaka <storchaka+cpyt...@gmail.com>:
>>> import typing >>> int | typing.T int | ~T >>> typing.T | int typing.Union[~T, int] >>> T2 = TypeVar('T2') >>> int | T2 typing.Union[int, ~T2] >>> T2 | int typing.Union[~T2, int] There is a support of TypeVar in type.__or__, but it does not work with user defined TypeVars, only with internal TypeVars defined in the typing module. ---------- components: Interpreter Core messages: 397466 nosy: gvanrossum, kj, serhiy.storchaka priority: normal severity: normal status: open title: Union with TypeVar does not work as intended type: behavior versions: Python 3.10, Python 3.11 _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue44632> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com