summaryrefslogtreecommitdiffstats
path: root/Doc/library/typing.rst
diff options
context:
space:
mode:
authorNikita Sobolev <mail@sobolevn.me>2021-12-24 21:36:09 (GMT)
committerGitHub <noreply@github.com>2021-12-24 21:36:09 (GMT)
commit1b30660c3b40da557050948ac8635f2dc50c4ee2 (patch)
treed958d26b6e7168597789d069769051a648bcf3c8 /Doc/library/typing.rst
parentb8de8b7039cee47465b2af9950b0b9ed2d3f2903 (diff)
downloadcpython-1b30660c3b40da557050948ac8635f2dc50c4ee2.zip
cpython-1b30660c3b40da557050948ac8635f2dc50c4ee2.tar.gz
cpython-1b30660c3b40da557050948ac8635f2dc50c4ee2.tar.bz2
bpo-46120: State that `|` is preferred over `Union` (GH-30222)
Co-authored-by: Éric <merwok@netwok.org> Co-authored-by: Guido van Rossum <gvanrossum@gmail.com>
Diffstat (limited to 'Doc/library/typing.rst')
-rw-r--r--Doc/library/typing.rst2
1 files changed, 1 insertions, 1 deletions
diff --git a/Doc/library/typing.rst b/Doc/library/typing.rst
index 727941b..08b59d8 100644
--- a/Doc/library/typing.rst
+++ b/Doc/library/typing.rst
@@ -625,7 +625,7 @@ These can be used as types in annotations using ``[]``, each having a unique syn
Union type; ``Union[X, Y]`` is equivalent to ``X | Y`` and means either X or Y.
- To define a union, use e.g. ``Union[int, str]`` or the shorthand ``int | str``. Details:
+ To define a union, use e.g. ``Union[int, str]`` or the shorthand ``int | str``. Using that shorthand is recommended. Details:
* The arguments must be types and there must be at least one.