Co-authored-by: Éric <merwok@netwok.org>
Co-authored-by: Guido van Rossum <gvanrossum@gmail.com>
(cherry picked from commit
1b30660c3b40da557050948ac8635f2dc50c4ee2)
Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
Automerge-Triggered-By: GH:gpshead
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.
--- /dev/null
+State that ``|`` is preferred for readability over ``Union`` in the :mod:`typing` docs.