Py3: Use rich comparison methods (__eq__, __lt__) instead of __cmp__

This commit is contained in:
Shadab Zafar 2016-05-31 20:02:01 +05:30
parent 7b6da98719
commit bda30efb35
1 changed files with 5 additions and 2 deletions

View File

@ -31,8 +31,11 @@ class _Action(base.Token):
c.offset = l + 1 c.offset = l + 1
return c return c
def __cmp__(self, other): def __lt__(self, other):
return cmp(self.offset, other.offset) return self.offset < other.offset
def __eq__(self, other):
return self.offset == other.offset
def __repr__(self): def __repr__(self):
return self.spec() return self.spec()