提交 c7aaaa0c authored 作者: Ian Goodfellow's avatar Ian Goodfellow

make update accept 0 arguments like dict.update

上级 6fb2a1e3
...@@ -45,7 +45,9 @@ class OrderedUpdates(OrderedDict): ...@@ -45,7 +45,9 @@ class OrderedUpdates(OrderedDict):
raise TypeError('OrderedUpdates keys must inherit from SharedVariable', raise TypeError('OrderedUpdates keys must inherit from SharedVariable',
key) key)
def update(self, other): def update(self, other=None):
if other is None:
return
for key, val in dict(other).iteritems(): for key, val in dict(other).iteritems():
if key in self: if key in self:
if self[key] == val: if self[key] == val:
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论