提交 8980e2e9 authored 作者: Frederic's avatar Frederic

Allow to remove a shared variable constructor from the list of default shared constructor.

上级 36a1208c
......@@ -153,10 +153,14 @@ class SharedVariable(Variable):
value = property(_value_get, _value_set),
def shared_constructor(ctor):
shared.constructors.append(ctor)
def shared_constructor(ctor, remove=False):
if remove:
shared.constructors.remove(ctor)
else:
shared.constructors.append(ctor)
return ctor
def shared(value, name=None, strict=False, allow_downcast=None, **kwargs):
"""Return a SharedVariable Variable, initialized with a copy or reference of `value`.
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论