summaryrefslogtreecommitdiffstats
path: root/Doc
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2020-11-19 16:51:01 (GMT)
committerGitHub <noreply@github.com>2020-11-19 16:51:01 (GMT)
commit2acd9d0c6ccf0b4360e3b63beddb97996bcb9bb1 (patch)
treea330c5d53da9c7d130f22ad39463919123dd06c0 /Doc
parent87c87b5bd6f6a5924b485398f353308410f9d8c1 (diff)
downloadcpython-2acd9d0c6ccf0b4360e3b63beddb97996bcb9bb1.zip
cpython-2acd9d0c6ccf0b4360e3b63beddb97996bcb9bb1.tar.gz
cpython-2acd9d0c6ccf0b4360e3b63beddb97996bcb9bb1.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 GH-23294. (cherry picked from commit 1b54077ff6f5c1379e097e9f8e8648da9826d6ec) Co-authored-by: Yurii Karabas <1998uriyyo@gmail.com>
Diffstat (limited to 'Doc')
-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 324abde..42a89ce 100644
--- a/Doc/library/typing.rst
+++ b/Doc/library/typing.rst
@@ -1687,9 +1687,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::