def copy ( obj ) : def copy ( self ) : """
        Copy self to a new object.
        """ from copy import deepcopy return deepcopy ( self ) obj . copy = copy return obj
python make a copy not reference
def copy(obj):
    def copy(self):
        """
        Copy self to a new object.
        """
        from copy import deepcopy

        return deepcopy(self)
    obj.copy = copy
    return obj