replace this parameter with another

def replaceWith(self, param):
        """replace this parameter with another"""
        i = self.parent().children().index(self)
        # TODO: transfer the children:
        p = self.parent()
        self.parent().removeChild(self)
        p.insertChild(i, param)
        self = param