[Python-Dev] PyObject_RichCompareBool identity shortcut (original) (raw)

Alexander Belopolsky alexander.belopolsky at gmail.com
Thu Apr 28 08:11:49 CEST 2011


On Thu, Apr 28, 2011 at 1:40 AM, Greg Ewing <greg.ewing at canterbury.ac.nz> wrote: ..

The Pythonic thing to do (in the Python 3 world at least) would be to regard NaNs as non-comparable and raise an exception.

As I mentioned in a previous post, I agree in case of <, <=, >, or >= comparisons, but == and != are a harder case because you don't want, for example:

[1,2,float('nan'),3].index(3) 3

to raise an exception.



More information about the Python-Dev mailing list