[Python-ideas] Disallow orderring comparison to NaN

Alexander Belopolsky alexander.belopolsky at gmail.com
Thu Apr 28 19:00:31 CEST 2011


On Thu, Apr 28, 2011 at 12:46 PM, Robert Kern <robert.kern at gmail.com> wrote:
..
> Python uses the < operator for sorting, not a comparison function, so it's
> current behavior is perfectly in line with the IEEE-754 spec.

No, it is not.  As I explained in the previous post, IEEE-754
prescribes different behavior for <, >, <=, and >= operations and !=
and ==.  The former signal INVALID exception while the later don't.
Python does not make this distinction.



More information about the Python-ideas mailing list