You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
assignee=Noneclosed_at=<Date2021-07-24.14:50:23.547>created_at=<Date2021-07-24.07:04:29.579>labels= ['interpreter-core', 'type-feature', '3.11']
title='Simplify implementation of the union type'updated_at=<Date2021-07-24.14:50:23.546>user='https://github.com/serhiy-storchaka'
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.
Activity
serhiy-storchaka commentedon Jul 24, 2021
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.
serhiy-storchaka commentedon Jul 24, 2021
It fixes also bpo-44642.
pablogsal commentedon Jul 24, 2021
New changeset 0828423 by Serhiy Storchaka in branch 'main':
bpo-44731: Simplify the union type implementation (GH-27318)
0828423
pablogsal commentedon Jul 24, 2021
New changeset ca5a4cf by Ken Jin in branch '3.10':
bpo-44731: Simplify the union type implementation (GH-27318) (GH-27334)
ca5a4cf