commit | dc817b229c972b2a881d08834a0612232dac7415 | [log] [tgz] |
---|---|---|
author | Stefan Krah <stefan@bytereef.org> | Wed Nov 17 11:16:34 2010 +0000 |
committer | Stefan Krah <stefan@bytereef.org> | Wed Nov 17 11:16:34 2010 +0000 |
tree | 0817f2bf1233fc07425430315cd838c63ffc5a86 | |
parent | 3ec60183a4e346dd2b12f4bb14dfbc2f90fe8218 [diff] [blame] |
Issue #10356: Decimal(-1).__hash__() should equal hash(Decimal(-1)).
diff --git a/Lib/decimal.py b/Lib/decimal.py index c3dffa3..5a9f840 100644 --- a/Lib/decimal.py +++ b/Lib/decimal.py
@@ -957,7 +957,8 @@ else: exp_hash = pow(_PyHASH_10INV, -self._exp, _PyHASH_MODULUS) hash_ = int(self._int) * exp_hash % _PyHASH_MODULUS - return hash_ if self >= 0 else -hash_ + ans = hash_ if self >= 0 else -hash_ + return -2 if ans == -1 else ans def as_tuple(self): """Represents the number as a triple tuple.