MCPcopy Create free account
hub / github.com/rthalley/dnspython / __lt__

Method __lt__

dns/serial.py:28–40  ·  view source on GitHub ↗
(self, other)

Source from the content-addressed store, hash-verified

26 return self.value != other.value
27
28 def __lt__(self, other):
29 if isinstance(other, int):
30 other = Serial(other, self.bits)
31 elif not isinstance(other, Serial) or other.bits != self.bits:
32 return NotImplemented
33 if self.value < other.value and other.value - self.value < 2 ** (self.bits - 1):
34 return True
35 elif self.value > other.value and self.value - other.value > 2 ** (
36 self.bits - 1
37 ):
38 return True
39 else:
40 return False
41
42 def __le__(self, other):
43 return self == other or self < other

Callers

nothing calls this directly

Calls 1

SerialClass · 0.85

Tested by

no test coverage detected