Fork me on GitHub"

# skbio.tree.TreeNode.pre_and_postorder

`TreeNode.``pre_and_postorder`(include_self=True)

  Performs iteration over tree, visiting node before and after

  State: Experimental as of 0.4.0.

  Parameters: | include_self (bool) – include the initial node if True
  Yields: | TreeNode – Traversed node.

  See also

  `traverse()`, `postorder()`, `preorder()`, `levelorder()`, `tips()`, `non_tips()`

  Examples

      >>> from skbio import TreeNode
      >>> tree = TreeNode.read(["((a,b)c);"])
      >>> for node in tree.pre_and_postorder():
      ...     print(node.name)
      None
      c
      a
      b
      c
      None