Skip to content

Commit 1d10bf0

Browse files
authored
bpo-43475: Add what's new entry for NaN hash changes (GH-26725)
1 parent cb2014f commit 1d10bf0

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

Doc/whatsnew/3.10.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -836,6 +836,13 @@ Other Language Changes
836836
effectless under ``from __future__ import annotations``.
837837
(Contributed by Batuhan Taskaya in :issue:`42725`.)
838838
839+
* Hashes of NaN values of both :class:`float` type and
840+
:class:`decimal.Decimal` type now depend on object identity. Formerly, they
841+
always hashed to ``0`` even though NaN values are not equal to one another.
842+
This caused potentially quadratic runtime behavior due to excessive hash
843+
collisions when creating dictionaries and sets containing multiple NaNs.
844+
(Contributed by Raymond Hettinger in :issue:`43475`.)
845+
839846
New Modules
840847
===========
841848

0 commit comments

Comments
 (0)