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

Switched the default strictness value of shared() back to strict=False.

Reason being there is a problem with the way we deal with strict. Strictness requires that a value has exactly the right type, but non-strictness implies just about any kind of casting including in-exact casting. What I would like the default to be is something that means casting is ok as long as it is exact.
上级 2dccbe6e
...@@ -116,7 +116,7 @@ def shared_constructor(ctor): ...@@ -116,7 +116,7 @@ def shared_constructor(ctor):
shared.constructors.append(ctor) shared.constructors.append(ctor)
return ctor return ctor
def shared(value, name=None, strict=True, **kwargs): def shared(value, name=None, strict=False, **kwargs):
"""Return a SharedVariable Variable, initialized with a copy or reference of `value`. """Return a SharedVariable Variable, initialized with a copy or reference of `value`.
This function iterates over constructor functions (see `shared_constructor`) to find a This function iterates over constructor functions (see `shared_constructor`) to find a
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论