提交 24dc3617 authored 作者: Pascal Lamblin's avatar Pascal Lamblin

Added a type check.

上级 dda502c4
...@@ -92,6 +92,10 @@ def pfunc(params, outputs=None, mode=None, updates=[], givens=[], ...@@ -92,6 +92,10 @@ def pfunc(params, outputs=None, mode=None, updates=[], givens=[],
if not isinstance(params,(list,tuple)): if not isinstance(params,(list,tuple)):
raise Exception("in pfunc() the first argument must be a list or a tuple") raise Exception("in pfunc() the first argument must be a list or a tuple")
if not isinstance(no_default_updates, bool)\
and not isinstance(no_default_updates, list):
raise TypeError("no_default_update should be either a boolean or a list")
clone_d = {} clone_d = {}
# Updates as list and dictionary. # Updates as list and dictionary.
# They will also store the 'default_update' expressions applicable. # They will also store the 'default_update' expressions applicable.
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论