More On - deepcopy, Tkinter

phil phillip.watts at anvilcom.com
Tue Jul 5 11:03:48 EDT 2005


 
> The deepcopy protocol does allow you to specify how complicated objects 
> should be copied. Try defining __deepcopy__() in your objects to just copy 
> the reference to the Canvas object instead of the object itself.
 
I can't figure out from the docs what __deepcopy__ is or how it

works.
I have about 25 classes of drawn objects. for instance
class linefromslope  creates an instance of class line.
One of my "ugly solutions" involves a  class prop: within each class,
put properties like slope and midpoint within the self.prop instance
and making a copy of that.
Would __deepcopy__ facilitate this?
Or am I assuming too much: is __deepcopy__ just a method
I invent to do what I want?







More information about the Python-list mailing list