(self)
Return a pre-order iterator for the tree.
Return a pre-order iterator for the tree.
Return a pre - order iterator for the tree .
def pre_order(self):
        """Return a pre-order iterator for the tree."""
        yield self
        for child in self.children:
            yield from child.pre_order()
def pre_order ( self ) : yield self for child in self . children : yield from child . pre_order ( )