Message7100

Author irmen
Recipients irmen
Date 2012-05-17.10:03:52
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1337249032.98.0.576339409902.issue1886@psf.upfronthosting.co.za>
In-reply-to
Content
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__'
History
Date User Action Args
2012-05-17 10:03:53irmensetrecipients: + irmen
2012-05-17 10:03:52irmensetmessageid: <1337249032.98.0.576339409902.issue1886@psf.upfronthosting.co.za>
2012-05-17 10:03:52irmenlinkissue1886 messages
2012-05-17 10:03:52irmencreate