nodify.visit_all_connected

nodify.visit_all_connected(nodes: Sequence[Node], func: Callable[[Node], Any], _seen_nodes=None) None[source]

Visit all nodes that are connected to a list of nodes.

Parameters:
  • nodes (Sequence[Node]) – The nodes to traverse.

  • func (Callable[[Node], Any]) – The function to apply to each node in the tree. Note that you can raise a StopTraverse exception to stop the traversal of the tree for any reason.