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: Add note to `typing.Union` that it is recommended to use `|` instead
Type: behavior Stage: resolved
Components: Documentation Versions: Python 3.11, Python 3.10
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: docs@python Nosy List: asvetlov, docs@python, gregory.p.smith, kj, lukasz.langa, miss-islington, sobolevn
Priority: normal Keywords: patch

Created on 2021-12-18 08:20 by sobolevn, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 30222 merged sobolevn, 2021-12-21 09:47
PR 30250 merged miss-islington, 2021-12-24 21:44
Messages (5)
msg408836 - (view) Author: Nikita Sobolev (sobolevn) * (Python triager) Date: 2021-12-18 08:20
As discussed in https://mail.python.org/archives/list/typing-sig@python.org/thread/TW5M6XDN7DO346RXMADKBAAGNSZPC4ZQ/

> we could probably stick a huge notice in the typing.Union docs saying `|` is preferred for readability in most cases, and not deprecate it for now.

I will send a PR to `Union` and `Optional` docs with this note today.
msg409158 - (view) Author: Gregory P. Smith (gregory.p.smith) * (Python committer) Date: 2021-12-24 21:36
New changeset 1b30660c3b40da557050948ac8635f2dc50c4ee2 by Nikita Sobolev in branch 'main':
bpo-46120: State that `|` is preferred over `Union` (GH-30222)
https://github.com/python/cpython/commit/1b30660c3b40da557050948ac8635f2dc50c4ee2
msg409302 - (view) Author: miss-islington (miss-islington) Date: 2021-12-29 11:45
New changeset ed1671ced7c9b951dfc16a0cf32a2b4eab914cf1 by Miss Islington (bot) in branch '3.10':
[3.10] bpo-46120: State that `|` is preferred over `Union` (GH-30222) (GH-30250)
https://github.com/python/cpython/commit/ed1671ced7c9b951dfc16a0cf32a2b4eab914cf1
msg409316 - (view) Author: Łukasz Langa (lukasz.langa) * (Python committer) Date: 2021-12-29 18:20
Haha, that backport took more time than I thought :D

Thanks! ✨ 🍰 ✨
msg409328 - (view) Author: Nikita Sobolev (sobolevn) * (Python triager) Date: 2021-12-29 21:33
Thank you for your time, Łukasz!
History
Date User Action Args
2022-04-11 14:59:53adminsetgithub: 90278
2021-12-29 21:33:41sobolevnsetmessages: + msg409328
2021-12-29 18:20:58lukasz.langasetnosy: + lukasz.langa
messages: + msg409316
2021-12-29 11:57:14AlexWaygoodsetstatus: open -> closed
resolution: fixed
stage: patch review -> resolved
2021-12-29 11:45:17miss-islingtonsetmessages: + msg409302
2021-12-24 21:44:39miss-islingtonsetnosy: + miss-islington
pull_requests: + pull_request28472
2021-12-24 21:36:38gregory.p.smithsetnosy: + gregory.p.smith
messages: + msg409158
2021-12-21 09:47:09sobolevnsetkeywords: + patch
stage: patch review
pull_requests: + pull_request28443
2021-12-18 08:21:16sobolevnsetnosy: + asvetlov, kj
2021-12-18 08:20:39sobolevncreate