提交 f23fa05b authored 作者: abalkin's avatar abalkin

Issue #783: python3 compatible - refactored any() into a loop to make python 3 happy.

In python 3, list comprehention variables do not leak in the outside scope. In this case the loop is actually cleaner.
上级 0b1778ee
......@@ -179,10 +179,11 @@ def rebuild_collect_shared(outputs,
# it is also not clear when/how to use the value of that shared
# variable (is it a default? ignored?, if the shared variable changes,
# does that function default also change?).
if any([isinstance(v, SharedVariable) for v in input_variables]):
raise TypeError(('Cannot use a shared variable (%s) as explicit '
'input. Consider substituting a non-shared'
' variable via the `givens` parameter') % v)
for v in input_variables:
if isinstance(v, SharedVariable):
raise TypeError(('Cannot use a shared variable (%s) as explicit '
'input. Consider substituting a non-shared'
' variable via the `givens` parameter') % v)
# Fill update_d and update_expr with provided updates
if updates is None:
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论