Hide navigation sidebar
Hide table of contents sidebar
Skip to content
ASDF Projects Tutorials Community
Back to top
View this page
Toggle table of contents sidebar

# iter_tree

asdf.treeutil.iter_tree(top)

  Iterate over all nodes in a tree, in depth-first order.

  Parameters:
    top object

      The root of the tree. May be a dict, list or other Python object.

    callback callable

      A function to call at each node in the tree.

      The callback is called on an instance after all of its children have been visited (depth-first order).

  Returns:
    tree object

      The modified tree.