def pre_order(self) -> Iterator[NL]:
        """Return a pre-order iterator for the tree."""
        yield self
        for child in self.children:
            yield from child.pre_order()
Return a pre-order iterator for the tree.
src/blib2to3/pytree.py