[Python-Dev] Decimal <-> float comparisons in py3k.

Greg Ewing greg.ewing at canterbury.ac.nz
Thu Mar 18 01:02:31 CET 2010


Raymond Hettinger wrote:

> Python 3 doesn't need it because it is possible to not give a result
> at all.  Python 2 does need it because we have to give *some*
> result.

That's not true -- it's possible for comparisons to raise
an exception in 2.x, and they sometimes do already:

Python 2.5.4 (r254:67916, May 15 2009, 15:21:20)
[GCC 4.1.2 20070925 (Red Hat 4.1.2-33)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
 >>> 1+2j < 3+4j
Traceback (most recent call last):
   File "<stdin>", line 1, in <module>
TypeError: no ordering relation is defined for complex numbers

-- 
Greg


More information about the Python-Dev mailing list