]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-77753: Add example for values that compare equal in stdtypes (GH-98497)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Wed, 26 Oct 2022 03:02:44 +0000 (20:02 -0700)
committerGitHub <noreply@github.com>
Wed, 26 Oct 2022 03:02:44 +0000 (20:02 -0700)
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
(cherry picked from commit 0ca6a4d64086055a8a3aa4b4c024fc080de148ab)

Co-authored-by: Stanley <46876382+slateny@users.noreply.github.com>
Doc/library/stdtypes.rst

index 14d2a27a87bac9926c5a30b8c6ddc37428603101..68b333acd8f00749732c9e119d0a8a8a10cff9d9 100644 (file)
@@ -4370,11 +4370,9 @@ type, the :dfn:`dictionary`.  (For other containers see the built-in
 A dictionary's keys are *almost* arbitrary values.  Values that are not
 :term:`hashable`, that is, values containing lists, dictionaries or other
 mutable types (that are compared by value rather than by object identity) may
-not be used as keys.  Numeric types used for keys obey the normal rules for
-numeric comparison: if two numbers compare equal (such as ``1`` and ``1.0``)
-then they can be used interchangeably to index the same dictionary entry.  (Note
-however, that since computers store floating-point numbers as approximations it
-is usually unwise to use them as dictionary keys.)
+not be used as keys.
+Values that compare equal (such as ``1``, ``1.0``, and ``True``)
+can be used interchangeably to index the same dictionary entry.
 
 .. class:: dict(**kwargs)
            dict(mapping, **kwargs)