Skip to content

Commit ab0a54a

Browse files
[3.9] bpo-44001: improve Literal documentation (GH-25877). (#25897)
(cherry picked from commit 87109f4) Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
1 parent ec18362 commit ab0a54a

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

Doc/library/typing.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -656,10 +656,10 @@ These can be used as types in annotations using ``[]``, each having a unique syn
656656
.. versionadded:: 3.8
657657

658658
.. versionchanged:: 3.9.1
659-
``Literal`` now de-duplicates parameters. Equality comparison of
659+
``Literal`` now de-duplicates parameters. Equality comparisons of
660660
``Literal`` objects are no longer order dependent. ``Literal`` objects
661661
will now raise a :exc:`TypeError` exception during equality comparisons
662-
if one of their parameters are not :term:`immutable`.
662+
if one of their parameters are not :term:`hashable`.
663663

664664
.. data:: ClassVar
665665

Doc/whatsnew/3.9.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1493,7 +1493,7 @@ and to match the behavior of static type checkers specified in the PEP.
14931493
now ``False``. To support this change, the internally used type cache now
14941494
supports differentiating types.
14951495
4. ``Literal`` objects will now raise a :exc:`TypeError` exception during
1496-
equality comparisons if one of their parameters are not :term:`immutable`.
1496+
equality comparisons if any of their parameters are not :term:`hashable`.
14971497
Note that declaring ``Literal`` with mutable parameters will not throw
14981498
an error::
14991499

0 commit comments

Comments
 (0)