8000 bpo-41428: Documentation for PEP 604 by Fidget-Spinner · Pull Request #22517 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

bpo-41428: Documentation for PEP 604 #22517

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 8 commits into from
Oct 5, 2020
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Add reference to generics
  • Loading branch information
Fidget-Spinner committed Oct 4, 2020
commit d983b027413906dc412463edbcf16a100af11e41
3 changes: 2 additions & 1 deletion Doc/library/stdtypes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4797,7 +4797,8 @@ enables cleaner type hinting syntax compared to :data:`typing.Union`.
>>> isinstance("", int | str)
True

However, union objects containing parameterized generics cannot be used::
However, union objects containing parameterized :ref:`generics<generics>`
cannot be used::

>>> isinstance(1, int | list[int])
TypeError: isinstance() argument 2 cannot contain a parameterized generic
Expand Down
0