Skip to content

Commit 7a25d27

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 8777d05 commit 7a25d27

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
@@ -4370,11 +4370,9 @@ type, the :dfn:`dictionary`. (For other containers see the built-in
43704370
A dictionary's keys are *almost* arbitrary values. Values that are not
43714371
:term:`hashable`, that is, values containing lists, dictionaries or other
43724372
mutable types (that are compared by value rather than by object identity) may
4373-
not be used as keys. Numeric types used for keys obey the normal rules for
4374-
numeric comparison: if two numbers compare equal (such as ``1`` and ``1.0``)
4375-
then they can be used interchangeably to index the same dictionary entry. (Note
4376-
however, that since computers store floating-point numbers as approximations it
4377-
is usually unwise to use them as dictionary keys.)
4373+
not be used as keys.
4374+
Values that compare equal (such as ``1``, ``1.0``, and ``True``)
4375+
can be used interchangeably to index the same dictionary entry.
43784376

43794377
.. class:: dict(**kwargs)
43804378
dict(mapping, **kwargs)

0 commit comments

Comments
 (0)