Skip to content

Commit 0f93725

Browse files
gh-77753: Add example for values that compare equal in stdtypes (GH-98497)
Co-authored-by: Jelle Zijlstra <[email protected]> (cherry picked from commit 0ca6a4d) Co-authored-by: Stanley <[email protected]>
1 parent 866dc74 commit 0f93725

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

Doc/library/stdtypes.rst

+3-5
Original file line numberDiff line numberDiff line change
@@ -4330,11 +4330,9 @@ type, the :dfn:`dictionary`. (For other containers see the built-in
43304330
A dictionary's keys are *almost* arbitrary values. Values that are not
43314331
:term:`hashable`, that is, values containing lists, dictionaries or other
43324332
mutable types (that are compared by value rather than by object identity) may
4333-
not be used as keys. Numeric types used for keys obey the normal rules for
4334-
numeric comparison: if two numbers compare equal (such as ``1`` and ``1.0``)
4335-
then they can be used interchangeably to index the same dictionary entry. (Note
4336-
however, that since computers store floating-point numbers as approximations it
4337-
is usually unwise to use them as dictionary keys.)
4333+
not be used as keys.
4334+
Values that compare equal (such as ``1``, ``1.0``, and ``True``)
4335+
can be used interchangeably to index the same dictionary entry.
43384336

43394337
.. class:: dict(**kwargs)
43404338
dict(mapping, **kwargs)

0 commit comments

Comments
 (0)