summaryrefslogtreecommitdiffstats
path: root/Doc/library/typing.rst
diff options
context:
space:
mode:
authorYurii Karabas <1998uriyyo@gmail.com>2020-11-19 16:17:38 (GMT)
committerGitHub <noreply@github.com>2020-11-19 16:17:38 (GMT)
commit1b54077ff6f5c1379e097e9f8e8648da9826d6ec (patch)
treec8de68da519cd471ef2ea002b8a1f51fa97a8203 /Doc/library/typing.rst
parentb437aa83f9374b86b7756705e8dc83b72a99e037 (diff)
downloadcpython-1b54077ff6f5c1379e097e9f8e8648da9826d6ec.zip
cpython-1b54077ff6f5c1379e097e9f8e8648da9826d6ec.tar.gz
cpython-1b54077ff6f5c1379e097e9f8e8648da9826d6ec.tar.bz2
bpo-42345: Fix hash implementation of typing.Literal (GH-23383)
Fix hash implementation of `typing.Literal`. Update docs regarding `typing.Litaral` caching. Base implementation was done in PR #23294.
Diffstat (limited to 'Doc/library/typing.rst')
-rw-r--r--Doc/library/typing.rst6
1 files changed, 3 insertions, 3 deletions
diff --git a/Doc/library/typing.rst b/Doc/library/typing.rst
index a8de984..5b66e3c 100644
--- a/Doc/library/typing.rst
+++ b/Doc/library/typing.rst
@@ -1706,9 +1706,9 @@ Introspection helpers
For a typing object of the form ``X[Y, Z, ...]`` these functions return
``X`` and ``(Y, Z, ...)``. If ``X`` is a generic alias for a builtin or
:mod:`collections` class, it gets normalized to the original class.
- If ``X`` is a :class:`Union` contained in another generic type,
- the order of ``(Y, Z, ...)`` may be different from the order of
- the original arguments ``[Y, Z, ...]`` due to type caching.
+ If ``X`` is a :class:`Union` or :class:`Literal` contained in another
+ generic type, the order of ``(Y, Z, ...)`` may be different from the order
+ of the original arguments ``[Y, Z, ...]`` due to type caching.
For unsupported objects return ``None`` and ``()`` correspondingly.
Examples::