diff options
author | Jelle Zijlstra <jelle.zijlstra@gmail.com> | 2021-05-04 08:54:12 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-05-04 08:54:12 (GMT) |
commit | 87109f4d85c93a870ee8aa0d2b394547d4636b17 (patch) | |
tree | 9d91c78b622a0e8794b6d151e0e75721d26e8659 /Doc/whatsnew | |
parent | 5017cde20ed1d163a55d95b34ca452d83771a581 (diff) | |
download | cpython-87109f4d85c93a870ee8aa0d2b394547d4636b17.zip cpython-87109f4d85c93a870ee8aa0d2b394547d4636b17.tar.gz cpython-87109f4d85c93a870ee8aa0d2b394547d4636b17.tar.bz2 |
bpo-44001: improve Literal documentation (GH-25877)
Diffstat (limited to 'Doc/whatsnew')
-rw-r--r-- | Doc/whatsnew/3.10.rst | 4 | ||||
-rw-r--r-- | Doc/whatsnew/3.9.rst | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/Doc/whatsnew/3.10.rst b/Doc/whatsnew/3.10.rst index eb452b0..3d5a188 100644 --- a/Doc/whatsnew/3.10.rst +++ b/Doc/whatsnew/3.10.rst @@ -1271,8 +1271,8 @@ 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`. - Note that declaring ``Literal`` with mutable parameters will not throw + equality comparisons if any of their parameters are not :term:`hashable`. + Note that declaring ``Literal`` with unhashable parameters will not throw an error:: >>> from typing import Literal diff --git a/Doc/whatsnew/3.9.rst b/Doc/whatsnew/3.9.rst index 772fb5a..f1725e7 100644 --- a/Doc/whatsnew/3.9.rst +++ b/Doc/whatsnew/3.9.rst @@ -1494,7 +1494,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:: |