[Python-Dev] PyObject_RichCompareBool identity shortcut

Steven D'Aprano steve at pearwood.info
Thu Apr 28 02:15:08 CEST 2011


Greg Ewing wrote:
> Guido van Rossum wrote:
> 
>> Maybe we should just call off the odd NaN comparison behavior?
> 
> That's probably as good an idea as anything.
> 
> The weirdness of NaNs is supposed to ensure that they
> propagate through a computation as a kind of exception
> signal. But to make that work properly, comparing two
> NaNs should really give you a NaB (Not a Boolean). As
> long as we're not doing that, we might as well treat
> NaNs sanely as Python objects.

That doesn't follow. You can compare NANs, and the result of the 
comparisons are perfectly well defined by either True or False. There's 
no need for a NAB comparison flag.



-- 
Steven



More information about the Python-Dev mailing list