提交 31ad3e30 authored 作者: carriepl's avatar carriepl

Force Symbolic input's update to have same type as variable

上级 a8eb76d9
......@@ -69,6 +69,13 @@ class SymbolicInput(object):
if self.name is not None and not isinstance(self.name, string_types):
raise TypeError("name must be a string! (got: %s)" % self.name)
self.update = update
if update is not None:
if not variable.type == update.type:
raise TypeError("Variable '%s' has type %s but an update of "
"type %s. The type of the update should be "
"the same as the type of the variable" %
(variable, variable.type, update.type))
if (mutable is not None):
self.mutable = mutable
else:
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论