[Python-ideas] checking for identity before comparing built-in objects
Joshua Landau
joshua.landau.ws at gmail.com
Wed Oct 10 00:13:57 CEST 2012
Just a curiosity here (as I can guess of plausible reasons myself, so there
probably are some official stances).
Is there a reason NaNs are not instances of NaN class? Then x == x would be
True (as they want), but [this NaN] == [that NaN] would be False, as
expected.
I guess that raises the question about why x == x but sqrt(-1) != sqrt(-1),
but it seems a lot less of a big deal than all of the exceptions with
container equalities.
Thanks,
Joshua
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20121009/61500174/attachment.html>
More information about the Python-ideas
mailing list