Do you think there should be a `__deepcopy__` method for `object`? This will solve a little problem I have here:
http://stackoverflow.com/questions/1933621/deepcopy-a-simple-python-object
I also think it's a more elegant solution than the way it works now.
Ram.
2009/12/20 Ram Rachum cool-rr@cool-rr.com:
Do you think there should be a `__deepcopy__` method for `object`?
No. Deep copy is an ill-defined concept. There is no universal notion of a deep copy, various applications need different amount of copying. Also, various applications need different amount of sharing and cycle detection while copying. There is no universal solution which fits all.
Use a domain-specific function instead.
On 12/20/2009 8:54 AM, Ram Rachum wrote:
Do you think there should be a `__deepcopy__` method for `object`? This will solve a little problem I have here:
http://stackoverflow.com/questions/1933621/deepcopy-a-simple-python-object
I also think it's a more elegant solution than the way it works now.
To me, the concept 'deepcopy' only applies to collections, and object instances are not collections, hence object.__deepcopy__ would be non-sensical.
Terry Jan Reedy