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

Method __init__

dns/zone.py:1082–1105  ·  view source on GitHub ↗
(self, version: Version)

Source from the content-addressed store, hash-verified

1080@dns.immutable.immutable
1081class ImmutableVersion(Version):
1082 def __init__(self, version: Version):
1083 if not isinstance(version, WritableVersion):
1084 raise ValueError(
1085 "a dns.zone.ImmutableVersion requires a dns.zone.WritableVersion"
1086 )
1087 # We tell super() that it's a replacement as we don't want it
1088 # to copy the nodes, as we're about to do that with an
1089 # immutable Dict.
1090 super().__init__(version.zone, True)
1091 # set the right id!
1092 self.id = version.id
1093 # keep the origin
1094 self.origin = version.origin
1095 # Make changed nodes immutable
1096 for name in version.changed:
1097 node = version.nodes.get(name)
1098 # it might not exist if we deleted it in the version
1099 if node:
1100 version.nodes[name] = ImmutableVersionedNode(node)
1101 # We're changing the type of the nodes dictionary here on purpose, so
1102 # we ignore the mypy error.
1103 self.nodes = dns.immutable.Dict(
1104 version.nodes, True, self.zone.map_factory
1105 ) # type: ignore
1106
1107
1108class Transaction(dns.transaction.Transaction):

Callers

nothing calls this directly

Calls 3

__init__Method · 0.45
getMethod · 0.45

Tested by

no test coverage detected