Steven D'Aprano wrote:
You can compare NANs, and the result of the comparisons are perfectly well defined by either True or False.
But it's *arbitrarily* defined, and it's far from clear that the definition chosen is useful in any way. If you perform a computation and get a NaN as the result, you know that something went wrong at some point. But if you subject that NaN to a comparison, your code takes some arbitrarily-chosen branch and produces a result that may look plausible but is almost certainly wrong. The Pythonic thing to do (in the Python 3 world at least) would be to regard NaNs as non-comparable and raise an exception. -- Greg _______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com