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

Method __init__

dns/btreezone.py:268–285  ·  view source on GitHub ↗
(self, version: dns.zone.Version)

Source from the content-addressed store, hash-verified

266@dns.immutable.immutable
267class ImmutableVersion(dns.zone.Version):
268 def __init__(self, version: dns.zone.Version):
269 if not isinstance(version, WritableVersion):
270 raise ValueError(
271 "a dns.btreezone.ImmutableVersion requires a "
272 "dns.btreezone.WritableVersion"
273 )
274 super().__init__(version.zone, True)
275 self.id = version.id
276 self.origin = version.origin
277 for name in version.changed:
278 node = version.nodes.get(name)
279 if node:
280 version.nodes[name] = ImmutableNode(node)
281 # the cast below is for mypy
282 self.nodes = cast(MutableMapping[dns.name.Name, dns.node.Node], version.nodes)
283 self.nodes.make_immutable() # type: ignore
284 self.delegations = version.delegations
285 self.delegations.make_immutable()
286
287 def bounds(self, name: dns.name.Name | str) -> Bounds:
288 """Return the 'bounds' of *name* in its zone.

Callers

nothing calls this directly

Calls 4

make_immutableMethod · 0.80
ImmutableNodeClass · 0.70
__init__Method · 0.45
getMethod · 0.45

Tested by

no test coverage detected