Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Doc/library/typing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
State that ``|`` is preferred for readability over ``Union`` in the :mod:`typing` docs.