def add_parent ( self , parent ) : parent . add_child ( self ) self . parent = parent return parent
python passing parent to child bad
Adds self as child of parent then adds parent .
def add_parent(self, parent):
        """
        Adds self as child of parent, then adds parent.
        """
        parent.add_child(self)
        self.parent = parent
        return parent