提交 5124f8e1 authored 作者: James Bergstra's avatar James Bergstra

adding value property to gof.Constant

上级 83b27034
...@@ -341,6 +341,8 @@ class Value(Variable): ...@@ -341,6 +341,8 @@ class Value(Variable):
if value is not None: if value is not None:
raise ValueError("Value instances cannot have an owner.") raise ValueError("Value instances cannot have an owner.")
owner = property(lambda self: None, __set_owner) owner = property(lambda self: None, __set_owner)
value = property(lambda self: self.data,
doc='read-only data access method')
# index is not defined, because the `owner` attribute must necessarily be None # index is not defined, because the `owner` attribute must necessarily be None
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论