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

Method __sub__

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

Source from the content-addressed store, hash-verified

89 return self
90
91 def __sub__(self, other):
92 v = self.value
93 if isinstance(other, Serial):
94 delta = other.value
95 elif isinstance(other, int):
96 delta = other
97 else:
98 raise ValueError
99 if abs(delta) > (2 ** (self.bits - 1) - 1):
100 raise ValueError
101 v -= delta
102 v = v % 2**self.bits
103 return Serial(v, self.bits)
104
105 def __isub__(self, other):
106 v = self.value

Callers

nothing calls this directly

Calls 1

SerialClass · 0.85

Tested by

no test coverage detected