提交 fa579c38 authored 作者: James Bergstra's avatar James Bergstra

minor bugfix - clone copies tags

上级 181939e0
...@@ -331,7 +331,10 @@ class Value(Variable): ...@@ -331,7 +331,10 @@ class Value(Variable):
return "<" + str(self.data) + ">" #+ "::" + str(self.type) return "<" + str(self.data) + ">" #+ "::" + str(self.type)
def clone(self): def clone(self):
"""WRITEME""" """WRITEME"""
return self.__class__(self.type, copy(self.data), self.name) #return copy(self)
cp = self.__class__(self.type, copy(self.data), self.name)
cp.tag = copy(self.tag)
return cp
def __set_owner(self, value): def __set_owner(self, value):
"""WRITEME """WRITEME
...@@ -369,7 +372,9 @@ class Constant(Value): ...@@ -369,7 +372,9 @@ class Constant(Value):
We clone this object, but we don't clone the data to lower memory requirement We clone this object, but we don't clone the data to lower memory requirement
We suppose that the data will never change. We suppose that the data will never change.
""" """
return self.__class__(self.type, self.data, self.name) cp = self.__class__(self.type, self.data, self.name)
cp.tag = copy(self.tag)
return cp
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论