Skip to content
Snippets Groups Projects
Unverified Commit 1b30660c authored by Nikita Sobolev's avatar Nikita Sobolev Committed by GitHub
Browse files

bpo-46120: State that `|` is preferred over `Union` (GH-30222)


Co-authored-by: default avatarÉric <merwok@netwok.org>
Co-authored-by: default avatarGuido van Rossum <gvanrossum@gmail.com>
parent b8de8b70
No related branches found
No related tags found
No related merge requests found
......@@ -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.
......
State that ``|`` is preferred for readability over ``Union`` in the :mod:`typing` docs.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment