
On Fri, Apr 29, 2011 at 8:10 AM, Guido van Rossum <guido@python.org> wrote:
On Thu, Apr 28, 2011 at 12:25 PM, Alexander Belopolsky <alexander.belopolsky@gmail.com> wrote:
I posted a patch implementing this proposal on the tracker:
Interesting indeed! I'd like to hear from the numpy folks about this.
But isn't a similar change needed for Decimal?
decimal already works that way:
from decimal import Decimal as d nan = d("nan") nan Decimal('NaN') nan < 1 Traceback (most recent call last): File "<stdin>", line 1, in <module> File "C:\Python32\lib\decimal.py", line 887, in __lt__ ans = self._compare_check_nans(other, context) File "C:\Python32\lib\decimal.py", line 788, in _compare_check_nans self) File "C:\Python32\lib\decimal.py", line 3926, in _raise_error raise error(explanation) decimal.InvalidOperation: comparison involving NaN
+1 from me for making float NaNs raise ValueError for ordering comparisons. Cheers, Nick. -- Nick Coghlan | ncoghlan@gmail.com | Brisbane, Australia