[Python-ideas] math.inf and math.nan constants

Guido van Rossum guido at python.org
Mon Jan 12 19:05:03 CET 2015

On Mon, Jan 12, 2015 at 8:54 AM, Chris Barker <chris.barker at noaa.gov> wrote:
> Being able to do x is math.nan, and have that give the answer most
> commonly wanted would be a nice way to spell, but, again, not worth
> breaking the now clear definition of "is".

While this discussion about what the meaning of "is" is is a funny in-joke
for those who remember the Clinton impeachment trials, that you even
considered it (and posted about it!) makes me shudder -- Python's "is"
operator is so closely tied to object identity that to propose overriding
it as a kind of "category" test makes me wonder if you understand Python at
all. Proposing to change "==" to make all NaNs appear equal would be less
earth-shattering -- that might go against all IEEE fp standards, but at
least Python's "==" operator is intended for that purpose.

--Guido van Rossum (python.org/~guido)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20150112/67fe8d93/attachment-0001.html>

More information about the Python-ideas mailing list