bpo-43475: Fix the Python implementation of hash of Decimal NaN (GH-26679)

This commit is contained in:
Serhiy Storchaka 2021-06-12 15:15:17 +03:00 committed by GitHub
parent 4a42cebf6d
commit 9f1c5f6e8a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 36 additions and 10 deletions

View file

@ -951,7 +951,7 @@ def __hash__(self):
if self.is_snan():
raise TypeError('Cannot hash a signaling NaN value.')
elif self.is_nan():
return super().__hash__()
return object.__hash__(self)
else:
if self._sign:
return -_PyHASH_INF