summaryrefslogtreecommitdiffstats
path: root/Doc/whatsnew
diff options
context:
space:
mode:
authorKen Jin <28750310+Fidget-Spinner@users.noreply.github.com>2021-02-09 01:57:11 (GMT)
committerGitHub <noreply@github.com>2021-02-09 01:57:11 (GMT)
commit5f77dee0560e923935203dc4c49279ddb19f57ed (patch)
tree26164b724293a038e757fd205aec0371b3c55b3f /Doc/whatsnew
parentd65b9033d6d092552775f6f5e41e7647100f9f2c (diff)
downloadcpython-5f77dee0560e923935203dc4c49279ddb19f57ed.zip
cpython-5f77dee0560e923935203dc4c49279ddb19f57ed.tar.gz
cpython-5f77dee0560e923935203dc4c49279ddb19f57ed.tar.bz2
Improve docs of PEP 604 Union (#24301)
Diffstat (limited to 'Doc/whatsnew')
-rw-r--r--Doc/whatsnew/3.10.rst8
1 files changed, 7 insertions, 1 deletions
diff --git a/Doc/whatsnew/3.10.rst b/Doc/whatsnew/3.10.rst
index fa8b6aa..96892ba 100644
--- a/Doc/whatsnew/3.10.rst
+++ b/Doc/whatsnew/3.10.rst
@@ -193,7 +193,13 @@ Type hints can now be written in a more succinct manner::
return number ** 2
-See :pep:`604` for more details.
+This new syntax is also accepted as the second argument to :func:`isinstance`
+and :func:`issubclass`::
+
+ >>> isinstance(1, int | str)
+ True
+
+See :ref:`types-union` and :pep:`604` for more details.
(Contributed by Maggie Moss and Philippe Prados in :issue:`41428`.)