Skip to content
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Improve comment wording
  • Loading branch information
rhettinger committed Apr 21, 2021
commit 9f3f9e9373b222a330b91a9156116891f4d0bede
6 changes: 3 additions & 3 deletions Python/pyhash.c
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,9 @@ static Py_ssize_t hashstats[Py_HASH_STATS_MAX + 1] = {0};
_PyHASH_INF and -_PyHASH_INF are also used for the
hashes of float and Decimal infinities.

NaNs hash to their object id. Having distinct hash values prevents
catastrophic piles-up for unique NaNs which used to always have
the same hash value but would compare unequal.
NaNs hash with a pointer hash. Having distinct hash values prevents
catastrophic pileups from distinct NaN instances which used to always
have the same hash value but would compare unequal.

A selling point for the above strategy is that it makes it possible
to compute hashes of decimal and binary floating-point numbers
Expand Down