commit | a07da09ad5bd7d234ccd084a3a0933c290d1b592 | [log] [tgz] |
---|---|---|
author | Raymond Hettinger <rhettinger@users.noreply.github.com> | Thu Apr 22 08:34:57 2021 -0700 |
committer | GitHub <noreply@github.com> | Thu Apr 22 08:34:57 2021 -0700 |
tree | 8c1ab67575527bd5c0c9452a74458ad5a29a1d08 | |
parent | accea7dc2bd30a6e8e1b0334acfca9585cbd7f8a [diff] [blame] |
bpo-43475: Fix worst case collision behavior for NaN instances (GH-25493)
diff --git a/Lib/_pydecimal.py b/Lib/_pydecimal.py index ab989e5..ff23322 100644 --- a/Lib/_pydecimal.py +++ b/Lib/_pydecimal.py
@@ -951,7 +951,7 @@ def __hash__(self): if self.is_snan(): raise TypeError('Cannot hash a signaling NaN value.') elif self.is_nan(): - return _PyHASH_NAN + return super().__hash__() else: if self._sign: return -_PyHASH_INF