]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.9] bpo-44001: improve Literal documentation (GH-25877). (#25897)
authorJelle Zijlstra <jelle.zijlstra@gmail.com>
Tue, 4 May 2021 16:48:41 +0000 (09:48 -0700)
committerGitHub <noreply@github.com>
Tue, 4 May 2021 16:48:41 +0000 (18:48 +0200)
(cherry picked from commit 87109f4d85c93a870ee8aa0d2b394547d4636b17)

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
Doc/library/typing.rst
Doc/whatsnew/3.9.rst

index b136da00a070ade97d4c05301c84d59b97391d49..06a8b813c2b44be310c29a2d5bfaad08de004ad9 100644 (file)
@@ -656,10 +656,10 @@ These can be used as types in annotations using ``[]``, each having a unique syn
    .. versionadded:: 3.8
 
    .. versionchanged:: 3.9.1
-      ``Literal`` now de-duplicates parameters.  Equality comparison of
+      ``Literal`` now de-duplicates parameters.  Equality comparisons of
       ``Literal`` objects are no longer order dependent. ``Literal`` objects
       will now raise a :exc:`TypeError` exception during equality comparisons
-      if one of their parameters are not :term:`immutable`.
+      if one of their parameters are not :term:`hashable`.
 
 .. data:: ClassVar
 
index cb492e458c6daaafcf11a37b19d05fd85b7984e4..7f790e5bd7555ee7478cac508795e0cac17ca80e 100644 (file)
@@ -1493,7 +1493,7 @@ and to match the behavior of static type checkers specified in the PEP.
    now ``False``.  To support this change, the internally used type cache now
    supports differentiating types.
 4. ``Literal`` objects will now raise a :exc:`TypeError` exception during
-   equality comparisons if one of their parameters are not :term:`immutable`.
+   equality comparisons if any of their parameters are not :term:`hashable`.
    Note that declaring ``Literal`` with mutable parameters will not throw
    an error::