Skip to content

Minor tweaks to typing union objects doc #22741

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Oct 20, 2020
Merged
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
6 changes: 3 additions & 3 deletions Doc/library/stdtypes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4798,7 +4798,7 @@ type hinting syntax compared to :data:`typing.Union`.

.. describe:: isinstance(obj, union_object)

Calls to :func:`isinstance` are also supported with a Union object::
Calls to :func:`isinstance` are also supported with a union object::

>>> isinstance("", int | str)
True
Expand All @@ -4819,7 +4819,7 @@ type hinting syntax compared to :data:`typing.Union`.

.. describe:: issubclass(obj, union_object)

Calls to :func:`issubclass` are also supported with a Union Object.::
Calls to :func:`issubclass` are also supported with a union object::

>>> issubclass(bool, int | str)
True
Expand All @@ -4837,7 +4837,7 @@ type hinting syntax compared to :data:`typing.Union`.
File "<stdin>", line 1, in <module>
TypeError: issubclass() argument 2 cannot contain a parameterized generic

The type for the Union object is :data:`types.Union`. An object cannot be
The type of a union object is :data:`types.Union`. An object cannot be
instantiated from the type::

>>> import types
Expand Down