[New-bugs-announce] [issue44731] Simplify implementation of the union type

Serhiy Storchaka report at bugs.python.org
Sat Jul 24 03:04:29 EDT 2021


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

The proposed PR simplifies implementation of the union type by removing direct support of typing types. It was not necessary because all these types implement __or__ and __ror__ methods.

The only visible difference is that int | TypeVar() etc returns now typing.Union instead of types.Union. But TypeVar() | int already returns typing.Union.

----------
components: Interpreter Core
messages: 398119
nosy: gvanrossum, kj, serhiy.storchaka, uriyyo
priority: normal
severity: normal
status: open
title: Simplify implementation of the union type
type: enhancement
versions: Python 3.11

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


More information about the New-bugs-announce mailing list