Title: int lacks __gt__, breaks functools.total_ordering
Type: crash Severity: normal
Components: Library Versions: 2.7a1
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: alex.gronholm Nosy List: alex.gronholm, fwierzbicki, irmen
Priority: high Keywords:

Created on 2012-05-17.10:03:52 by irmen, last changed 2012-10-28.13:07:59 by alex.gronholm.

msg7100 (view) Author: Irmen de Jong (irmen) Date: 2012-05-17.10:03:52
It seems that the 'int' type lacks at least one rich comparison operator namely __gt__. This breaks functools.total_ordering, for instance:

from functools import total_ordering

class Ordered(object):
    def __eq__(self, other):
        return self is other
    def __lt__(self, other):
        return  False

Traceback (most recent call last):
  File "", line 3, in <module>
  File "E:\jython27\Lib\", line 76, in total_ordering
    opfunc.__doc__ = getattr(int, opname).__doc__
AttributeError: type object 'int' has no attribute '__gt__'
msg7494 (view) Author: Alex Grönholm (alex.gronholm) Date: 2012-10-28.13:07:59
Fixed in changeset 77c30d41b6fa. Hopefully PyObject.equals() is the right choice for checking equality between types.
Date User Action Args
2012-10-28 13:07:59alex.gronholmsetstatus: open -> closed
assignee: fwierzbicki -> alex.gronholm
resolution: fixed
messages: + msg7494
nosy: + alex.gronholm
2012-05-18 17:31:54fwierzbickisetpriority: high
assignee: fwierzbicki
nosy: + fwierzbicki
2012-05-17 10:03:52irmencreate