def clone_via_serialize(obj):
 s = cPickle.dumps(obj, get_pickle_protocol())
 return cPickle.loads(s)

def clone_via_serialize ( obj ) : s = cPickle . dumps ( obj , get_pickle_protocol ( ) ) return cPickle . loads ( s )
makes a "deep copy" of an object by serializing it and then deserializing it .