A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2009-November/093948.html below:

[Python-Dev] decimal.py: == and != comparisons involving NaNs

[Python-Dev] decimal.py: == and != comparisons involving NaNs [Python-Dev] decimal.py: == and != comparisons involving NaNsMark Dickinson dickinsm at gmail.com
Mon Nov 9 13:40:06 CET 2009
On Mon, Nov 9, 2009 at 12:21 PM, Stefan Krah <stefan-usenet at 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
More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4