In article <mailman.942.1243748839.8015.python-l...@python.org>, Michael H. Goldwasser <goldw...@slu.edu> wrote: > >Assume that class B inherits from class A, and that class A has >legitimately customized its deepcopy semantics (but in a way that is >not known to class B). If we want a deepcopy of B to be defined so >that relevant state inherited from A is copied as would be done for >class A, and with B able to control how to deepcopy the extra state >that it introduces. I cannot immediately find a general way to >properly implement the deepcopy of B. > > [...] > >class A(object): > def __init__(self, aTag): > self.__aTag = aTag > self.__aList = []
IMO, your problem starts right here. Not only are you using customized attributes for each class, you're using class-private identifiers. You would vastly simplify your work if you switch to single-underscore attributes. -- Aahz (a...@pythoncraft.com) <*> http://www.pythoncraft.com/ my-python-code-runs-5x-faster-this-month-thanks-to-dumping-$2K- on-a-new-machine-ly y'rs - tim -- http://mail.python.org/mailman/listinfo/python-list