Comments
Patch
@@ -174,7 +174,14 @@ class IncludeHistory(object):
self.filename = filename or '[TOP LEVEL]'
self.children = []
self.current = self
- self.variables = {}
+ self.variables = COWDictBase.copy()
+
+ def copy(self):
+ new = IncludeHistory(self.parent, self.filename, self.datasmart)
+ new.children = copy.deepcopy(self.children)
+ new.current = self.current
+ new.variables = self.variables.copy()
+ return new
def include(self, filename):
newfile = IncludeHistory(self.current, filename)
@@ -615,7 +622,7 @@ class DataSmart(MutableMapping):
# we really want this to be a DataSmart...
data = DataSmart(seen=self._seen_overrides.copy(), special=self._special_values.copy())
data.dict["_data"] = self.dict
- data.history = copy.deepcopy(self.history)
+ data.history = self.history.copy()
data.history.datasmart = data
data._tracking = self._tracking