def inorder(self, funct, stopOn=None):
        """ Iterates in order, calling the function with the current node.
        If stopOn is set to True or False, it will stop on true or false.
        """
        if stopOn is None:
            for i in self.children:
                i.inorder(funct)
        else:
            for i in self.children:
                if i.inorder(funct) == stopOn:
                    return stopOn

        return funct(self)
def inorder ( self , funct , stopOn = None ) : if stopOn is None : for i in self . children : i . inorder ( funct ) else : for i in self . children : if i . inorder ( funct ) == stopOn : return stopOn return funct ( self )
Iterates in order, calling the function with the current node.
        If stopOn is set to True or False, it will stop on true or false.