def presubtree(self):
            """Preorder iterator over the subtrees.

            Warning: As always, do not use this iterator in a for loop
            while altering the structure of the tree."""

            if self:
                yield self
                for subtree in self.subtrees:
                    for tree in subtree.presubtree():
                        yield tree
Preorder iterator over the subtrees.

            Warning: As always, do not use this iterator in a for loop
            while altering the structure of the tree.
recipes/Python/201423_Trees_and_more_trees_part_II/recipe-201423.py