[New-bugs-announce] [issue46120] Add note to `typing.Union` that it is recommended to use `|` instead

Nikita Sobolev report at bugs.python.org
Sat Dec 18 03:20:39 EST 2021


New submission from Nikita Sobolev <mail at sobolevn.me>:

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.

----------
assignee: docs at python
components: Documentation
messages: 408836
nosy: docs at python, sobolevn
priority: normal
severity: normal
status: open
title: Add note to `typing.Union` that it is recommended to use `|` instead
type: behavior
versions: Python 3.10, Python 3.11

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


More information about the New-bugs-announce mailing list