mirror of
https://github.com/python/cpython.git
synced 2025-11-25 04:34:37 +00:00
Issue #10356: hash(Decimal("sNaN")) now raises ValueError instead of TypeError.
This commit is contained in:
parent
d28f790b69
commit
d8b661dd90
3 changed files with 5 additions and 2 deletions
|
|
@ -943,7 +943,7 @@ class Decimal(object):
|
|||
# in the documentation. (See library docs, 'Built-in Types').
|
||||
if self._is_special:
|
||||
if self.is_snan():
|
||||
raise TypeError('Cannot hash a signaling NaN value.')
|
||||
raise ValueError('Cannot hash a signaling NaN value.')
|
||||
elif self.is_nan():
|
||||
return _PyHASH_NAN
|
||||
else:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue