Meador Inge <mead...@gmail.com> added the comment:

2.7 patch attached.  The implementation is mostly the same as the 3.2 one, but 
there is one quirk.  Namely, 2.7 (and other 2.x's) has the following odd 
behavior:

   >>> 1j < None
   False
   >>> 1j < 1
   Traceback (most recent call last):
     File "<stdin>", line 1, in <module>
   TypeError: no ordering relation is defined for complex numbers

To perserve this behavior I had to do the type checks for 'int', 'long', 
'complex', and 'float' at the beginning.  I tried 'PyNumber_Check' first, but 
it returns 1 for old-style classes since the number protocol is filled in for 
the 'instance' type.

----------
Added file: http://bugs.python.org/file17425/issue-8748.py27.patch

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue8748>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to