lstree/nodes/node.py
def prune(self, predicate):
        """
        allow a visitor predicate to choose candidates to prune
        then prune the chosen ones out
        :param predicate: any function that takes in a Node and returns True or False
        :return: nothing
        """
        # send it downwards first. process at the leaf nodes first, then bubble up
        for c in self._children:
            c.prune(predicate)

        # now actually prune children that match the predicate
        self._children = [c for c in self._children if not predicate(c)]

        allow a visitor predicate to choose candidates to prune
        then prune the chosen ones out
        :param predicate: any function that takes in a Node and returns True or False
        :return: nothing
        
allow a visitor predicate to choose candidates to prune
then prune the chosen ones out
allow a visitor predicate to choose candidates to prune then prune the chosen ones out
def prune(self, predicate):
        for c in self._children:
            c.prune(predicate)
        self._children = [c for c in self._children if not predicate(c)]
def prune ( self , predicate ) : for c in self . _children : c . prune ( predicate ) self . _children = [ c for c in self . _children if not predicate ( c ) ]
allow a visitor predicate to choose candidates to prune
then prune the chosen ones out
allow a visitor predicate to choose candidates to prune then prune the chosen ones out
"""
        allow a visitor predicate to choose candidates to prune
        then prune the chosen ones out
        :param predicate: any function that takes in a Node and returns True or False
        :return: nothing
        """ # send it downwards first. process at the leaf nodes first, then bubble up # now actually prune children that match the predicate
None
self
predicate
any function that takes in a Node and returns True or False
any function that takes in a Node and returns True or False