merged png and string output into one function
This commit is contained in:
Родитель
bf5e28b4f3
Коммит
43e8581e03
|
@ -9,7 +9,7 @@ def dfs_walk(node, visitor):
|
|||
Generic function that walks through the graph starting at ``node`` and
|
||||
uses function ``visitor`` on each node to check whether it should be
|
||||
returned.
|
||||
|
||||
|
||||
Args:
|
||||
node (graph node): the node to start the journey from
|
||||
visitor (Python function or lambda): function that takes a node as
|
||||
|
@ -38,8 +38,8 @@ def dfs_walk(node, visitor):
|
|||
except AttributeError:
|
||||
pass
|
||||
|
||||
if visitor(node):
|
||||
accum.append(node)
|
||||
if visitor(node):
|
||||
accum.append(node)
|
||||
|
||||
visited.add(node)
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче