Skip to content

[3.10] gh-77753: Add example for values that compare equal in stdtypes (GH-98497) #98694

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 26, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
gh-77753: Add example for values that compare equal in stdtypes (GH-9…
…8497)

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
(cherry picked from commit 0ca6a4d)

Co-authored-by: Stanley <46876382+slateny@users.noreply.github.com>
  • Loading branch information
slateny authored and miss-islington committed Oct 26, 2022
commit 02a632f15fb65ee3613b9aa7012c34cc30c2273b
8 changes: 3 additions & 5 deletions Doc/library/stdtypes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4330,11 +4330,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)
Expand Down