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.

classification
Title: Simplify implementation of the union type
Type: enhancement Stage: resolved
Components: Interpreter Core Versions: Python 3.11
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: gvanrossum, kj, pablogsal, serhiy.storchaka, uriyyo
Priority: normal Keywords: patch

Created on 2021-07-24 07:04 by serhiy.storchaka, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 27318 merged serhiy.storchaka, 2021-07-24 07:07
PR 27334 merged kj, 2021-07-24 14:17
Messages (4)
msg398119 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2021-07-24 07:04
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.
msg398124 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2021-07-24 09:08
It fixes also issue44642.
msg398155 - (view) Author: Pablo Galindo Salgado (pablogsal) * (Python committer) Date: 2021-07-24 13:34
New changeset 08284231275ac9cc60ae27eab2338805919d8881 by Serhiy Storchaka in branch 'main':
bpo-44731: Simplify the union type implementation (GH-27318)
https://github.com/python/cpython/commit/08284231275ac9cc60ae27eab2338805919d8881
msg398160 - (view) Author: Pablo Galindo Salgado (pablogsal) * (Python committer) Date: 2021-07-24 14:49
New changeset ca5a4cf8266cf789eae379fe224458e94dd41b30 by Ken Jin in branch '3.10':
bpo-44731: Simplify the union type implementation (GH-27318) (GH-27334)
https://github.com/python/cpython/commit/ca5a4cf8266cf789eae379fe224458e94dd41b30
History
Date User Action Args
2022-04-11 14:59:47adminsetgithub: 88894
2021-07-24 14:50:23pablogsalsetstatus: open -> closed
resolution: fixed
stage: patch review -> resolved
2021-07-24 14:49:32pablogsalsetmessages: + msg398160
2021-07-24 14:17:35kjsetpull_requests: + pull_request25877
2021-07-24 13:34:56pablogsalsetnosy: + pablogsal
messages: + msg398155
2021-07-24 09:08:28serhiy.storchakasetmessages: + msg398124
2021-07-24 07:07:50serhiy.storchakasetkeywords: + patch
stage: patch review
pull_requests: + pull_request25863
2021-07-24 07:04:29serhiy.storchakacreate