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/093934.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 NaNsRobert Kern robert.kern at gmail.com
Mon Nov 9 05:20:35 CET 2009
Antoine Pitrou wrote:
> Stefan Krah <stefan-usenet <at> bytereef.org> writes:
>> Are there cases where == and != are actually needed to give a result
>> for NaNs?
> 
> It is a common expectation that == and != always succeed. They return True or
> False, but don't raise an exception even on unrelated operands:

It is a common expectation, but a false one. __eq__ and __ne__ are explicitly 
allowed to return anything, not just bools.

http://www.python.org/dev/peps/pep-0207/

-- 
Robert Kern

"I have come to believe that the whole world is an enigma, a harmless enigma
  that is made terrible by our own mad attempt to interpret it as though it had
  an underlying truth."
   -- Umberto Eco

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