]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-43475: Add what's new entry for NaN hash changes (GH-26725)
authorMark Dickinson <mdickinson@enthought.com>
Tue, 15 Jun 2021 18:48:35 +0000 (19:48 +0100)
committerGitHub <noreply@github.com>
Tue, 15 Jun 2021 18:48:35 +0000 (19:48 +0100)
Doc/whatsnew/3.10.rst

index 249eb733a88bf8147ae8d5a8fdd9e7f7c42c97ad..9b9dd31a3beabf0e0bb5bf43eeb654d76568f0db 100644 (file)
@@ -836,6 +836,13 @@ Other Language Changes
   effectless under ``from __future__ import annotations``.
   (Contributed by Batuhan Taskaya in :issue:`42725`.)
 
+* Hashes of NaN values of both :class:`float` type and
+  :class:`decimal.Decimal` type now depend on object identity. Formerly, they
+  always hashed to ``0`` even though NaN values are not equal to one another.
+  This caused potentially quadratic runtime behavior due to excessive hash
+  collisions when creating dictionaries and sets containing multiple NaNs.
+  (Contributed by Raymond Hettinger in :issue:`43475`.)
+
 New Modules
 ===========