Nov. 9, 2009
4:40 a.m.
On Mon, Nov 9, 2009 at 12:21 PM, Stefan Krah <stefan-usenet@bytereef.org> wrote:
I see the point, but Decimal("NaN") does not hash:
hash(Decimal("NaN")) Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/usr/lib/python2.7/decimal.py", line 937, in __hash__ raise TypeError('Cannot hash a NaN value.') TypeError: Cannot hash a NaN value.
I think that may represent an excess of caution. float nans do hash quite happily, and I can't see a good reason for preventing Decimal nans from having a hash. Mark