Tutorials
Library walkthrough
Reference documentation
traverse_tree_forward()
Traverse a tree of nodes in a forward fashion.
roots (Sequence[Node]) – The roots of the tree 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.