Closed tclose closed 7 years ago
I don't know without spending a lot more time with the code. I think the use of the Visitor pattern is possibly overkill here.
I just ran into a problem trying to deepcopy an object where it copied the document it belonged to as well, since all "document-level" objects contain a reference to the document they belong to. So having cloner methods is probably a good idea. Maybe all classes should implement a 'clone(self)' method for consistency between abstraction and user (property/state) layers.
I have decided that having separate deepcopy and cloner methods is probably a good idea
I can't work out whether
*Cloner
methods should be mapped to__copy__
or__deepcopy__
magic methods. In fact I am not sure the point of the cloner visitors are the first place, as__deepcopy__
should do the job no?