Beispiel #1
0
 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)
Beispiel #2
0
 def cmp_(self, other):
     """Compare other to self as integers."""
     return cmp(int(self), int(other))
Beispiel #3
0
 def cmp_(self, other):
     """Compare self.value to self.other as integers with 'cmp'."""
     return cmp(int(self), int(other))
Beispiel #4
0
 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)
Beispiel #5
0
 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)
Beispiel #6
0
 def _cmp(self, other: 'IntegerInterval') -> int:
     """Compare other to self as integers."""
     return cmp(int(self), int(other))
Beispiel #7
0
 def _cmp(self, other: 'IntegerPoint') -> int:
     """Compare self.value to self.other as integers with 'cmp'."""
     return cmp(int(self), int(other))
Beispiel #8
0
 def cmp_(self, other):
     """Compare other to self as integers."""
     return cmp(int(self), int(other))
Beispiel #9
0
 def cmp_(self, other):
     """Compare self.value to self.other as integers with 'cmp'."""
     return cmp(int(self), int(other))