提交 933aed5e authored 作者: Frederic Bastien's avatar Frederic Bastien

doc the then env call back on_change_input have an optional reason keyword and…

doc the then env call back on_change_input have an optional reason keyword and accept it on more case to remove useless error.
上级 f75bf51b
......@@ -49,7 +49,7 @@ class Env(utils.object2):
Called whenever a node is pruned (removed) from the env,
after it is disconnected from the graph.
- feature.on_change_input(env, node, i, r, new_r)*
- feature.on_change_input(env, node, i, r, new_r, [reason=None])*
Called whenever node.inputs[i] is changed from r to new_r.
At the moment the callback is done, the change has already
taken place.
......
......@@ -186,12 +186,12 @@ class PrintListener(object):
if self.active:
print "-- pruning: %s" % node
def on_change_input(self, env, node, i, r, new_r):
def on_change_input(self, env, node, i, r, new_r, reason=None):
if self.active:
print "-- changing (%s.inputs[%s]) from %s to %s" % (node, i, r, new_r)
class PreserveNames:
def on_change_input(self, env, mode, i, r, new_r):
def on_change_input(self, env, mode, i, r, new_r, reason=None):
if r.name is not None and new_r.name is None:
new_r.name = r.name
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论