提交 3625938d authored 作者: Olivier Breuleux's avatar Olivier Breuleux

Value cannot have an owner

上级 6291e64b
...@@ -128,6 +128,10 @@ class Value(Result): ...@@ -128,6 +128,10 @@ class Value(Result):
return "<" + str(self.data) + ">" #+ "::" + str(self.type) return "<" + str(self.data) + ">" #+ "::" + str(self.type)
def clone(self): def clone(self):
return self.__class__(self.type, self.data) return self.__class__(self.type, self.data)
def __set_owner(self, value):
if value is not None:
raise ValueError("Value instances cannot have an owner.")
owner = property(lambda self: None, __set_owner)
class Constant(Value): class Constant(Value):
#__slots__ = ['data'] #__slots__ = ['data']
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论