pytholite/transel: use python3-compatible comparison methods

This commit is contained in:
Sebastien Bourdeauducq 2012-11-17 23:16:07 +01:00
parent 6434ddd95a
commit e92af9de59
1 changed files with 17 additions and 2 deletions

View File

@ -156,8 +156,23 @@ class Register:
def __index__(self): def __index__(self):
return int(self._val) return int(self._val)
def __cmp__(self, other): def __lt__(self, other):
return cmp(self._val, other) return self._val < other
def __le__(self, other):
return self._val <= other
def __eq__(self, other):
return self._val == other
def __ge__(self, other):
return self._val >= other
def __gt__(self, other):
return self._val > other
def __ne__(self, other):
return self._val != other
def __str__(self): def __str__(self):
return str(self._val) return str(self._val)