diff options
Diffstat (limited to 'pathod')
-rw-r--r-- | pathod/language/actions.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/pathod/language/actions.py b/pathod/language/actions.py index 34a9bafb..e85affac 100644 --- a/pathod/language/actions.py +++ b/pathod/language/actions.py @@ -1,12 +1,14 @@ import abc import copy import random +from functools import total_ordering import pyparsing as pp from . import base +@total_ordering class _Action(base.Token): """ @@ -31,8 +33,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() |