On Mon, Nov 9, 2009 at 12:21 PM, Stefan Krah <stefan-use...@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 _______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com