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/093946.html below:

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

[Python-Dev] decimal.py: == and != comparisons involving NaNsAntoine Pitrou solipsis at pitrou.net
Mon Nov 9 13:34:54 CET 2009
Stefan Krah <stefan-usenet <at> bytereef.org> writes:
> 
> I see the point, but Decimal("NaN") does not hash:

Ok but witness again:

>>> L = [1, 2, Decimal("NaN"), 3]
>>> 3 in L
True
>>> class H(object):
...   def __eq__(self, other): raise ValueError
... 
>>> L = [1, 2, H(), 3]
>>> 3 in L
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "<stdin>", line 2, in __eq__
ValueError


(NB: interestingly, float("nan") does hash)

Regards

Antoine.


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