def __cmp__(self, other): # Compare other (point) to self. if other is None: return -1 if self.TYPE != other.TYPE: return cmp(self.TYPE_SORT_KEY, other.TYPE_SORT_KEY) if self.value == other.value: return 0 return self._iso_point_cmp(self.value, other.value)
def cmp_(self, other): """Compare other to self as integers.""" return cmp(int(self), int(other))
def cmp_(self, other): """Compare self.value to self.other as integers with 'cmp'.""" return cmp(int(self), int(other))
def _iso_interval_cmp(interval_string, other_interval_string): """Compare one parsed interval_string with the other one.""" interval = interval_parse(interval_string) other = interval_parse(other_interval_string) return cmp(interval, other)
def _iso_point_cmp(point_string, other_point_string): """Compare the parsed point_string to the other one.""" point = point_parse(point_string) other_point = point_parse(other_point_string) return cmp(point, other_point)
def _cmp(self, other: 'IntegerInterval') -> int: """Compare other to self as integers.""" return cmp(int(self), int(other))
def _cmp(self, other: 'IntegerPoint') -> int: """Compare self.value to self.other as integers with 'cmp'.""" return cmp(int(self), int(other))
def cmp_(self, other): """Compare other to self as integers.""" return cmp(int(self), int(other))
def cmp_(self, other): """Compare self.value to self.other as integers with 'cmp'.""" return cmp(int(self), int(other))