Implement the new comparison methods for SlackTS
Python 3 no longer respects __cmp__, as it has more fine-grained hooks
for ordering/comparison. To minimize code changes, implement them in
terms of the existing __cmp__ method.
@@ -2392,6 +2392,21 @@ class SlackTS(object):
elif s == other:
return 0
+ def __lt__(self, other):
+ return self.__cmp__(other) < 0
+
+ def __le__(self, other):
+ return self.__cmp__(other) <= 0
+
+ def __eq__(self, other):
+ return self.__cmp__(other) == 0
+
+ def __ge__(self, other):
+ return self.__cmp__(other) >= 0
+
+ def __gt__(self, other):
+ return self.__cmp__(other) > 0
+
def __hash__(self):
return hash("{}.{}".format(self.major, self.minor))
