Message7100
It seems that the 'int' type lacks at least one rich comparison operator namely __gt__. This breaks functools.total_ordering, for instance:
E:\projects\Mud>type error1.py
from functools import total_ordering
@total_ordering
class Ordered(object):
def __eq__(self, other):
return self is other
def __lt__(self, other):
return False
E:\projects\Mud>\jython27\jython.bat error1.py
Traceback (most recent call last):
File "error1.py", line 3, in <module>
@total_ordering
File "E:\jython27\Lib\functools.py", line 76, in total_ordering
opfunc.__doc__ = getattr(int, opname).__doc__
AttributeError: type object 'int' has no attribute '__gt__' |
|
Date |
User |
Action |
Args |
2012-05-17 10:03:53 | irmen | set | recipients:
+ irmen |
2012-05-17 10:03:52 | irmen | set | messageid: <1337249032.98.0.576339409902.issue1886@psf.upfronthosting.co.za> |
2012-05-17 10:03:52 | irmen | link | issue1886 messages |
2012-05-17 10:03:52 | irmen | create | |
|