From bda30efb35af25027b16b478e3916c97f52b5157 Mon Sep 17 00:00:00 2001 From: Shadab Zafar Date: Tue, 31 May 2016 20:02:01 +0530 Subject: Py3: Use rich comparison methods (__eq__, __lt__) instead of __cmp__ --- pathod/language/actions.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'pathod/language') diff --git a/pathod/language/actions.py b/pathod/language/actions.py index 34a9bafb..2aea870f 100644 --- a/pathod/language/actions.py +++ b/pathod/language/actions.py @@ -31,8 +31,11 @@ class _Action(base.Token): c.offset = l + 1 return c - def __cmp__(self, other): - return cmp(self.offset, other.offset) + def __lt__(self, other): + return self.offset < other.offset + + def __eq__(self, other): + return self.offset == other.offset def __repr__(self): return self.spec() -- cgit v1.2.3