def __deepcopy__ ( self , memo ) : # noinspection PyArgumentList return self . __class__ ( * * { key : deepcopy ( getattr ( self , key ) , memo ) for key in self . keys } )
how do you do deepcopy in python
Create a deep copy of the node
def __deepcopy__(self, memo):
        """Create a deep copy of the node"""
        # noinspection PyArgumentList
        return self.__class__(
            **{key: deepcopy(getattr(self, key), memo) for key in self.keys}
        )