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

Method __add__

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

Source from the content-addressed store, hash-verified

60 return self == other or self > other
61
62 def __add__(self, other):
63 v = self.value
64 if isinstance(other, Serial):
65 delta = other.value
66 elif isinstance(other, int):
67 delta = other
68 else:
69 raise ValueError
70 if abs(delta) > (2 ** (self.bits - 1) - 1):
71 raise ValueError
72 v += delta
73 v = v % 2**self.bits
74 return Serial(v, self.bits)
75
76 def __iadd__(self, other):
77 v = self.value

Callers

nothing calls this directly

Calls 1

SerialClass · 0.85

Tested by

no test coverage detected