63 |
attributes[duri] = {} |
attributes[duri] = {} |
64 |
self.raw = raw |
self.raw = raw |
65 |
|
|
66 |
def copy(self): |
def copy(self, newclass=None): |
67 |
copy = self.__class__(self.ns, self.name, {}, self.nsdecls.copy(), self.raw) |
if newclass is None: |
68 |
|
newclass = self.__class__ |
69 |
|
copy = newclass(self.ns, self.name, {}, self.nsdecls.copy(), self.raw) |
70 |
# attributes is copied with one level of depth |
# attributes is copied with one level of depth |
71 |
for ns, attrs in self.attributes.items(): |
for ns, attrs in self.attributes.items(): |
72 |
copy.attributes[ns] = attrs.copy() |
copy.attributes[ns] = attrs.copy() |