[Zope-dev] Cloning Object in Python

Dody Gunawinata dody_g@eles.com
Wed, 15 Sep 1999 12:12:48 +1000


Sorry, it's a bit off topic.

Is there any standard Python way to clone/copy an object ?

I usually create a methods that create a new object and assign it with
the current value of the 'copied' object.

NewObject = OldObject.Copy

This works although it gets a bit nasty with Inheritance, and I wouldn't
be able to 'clone' any
run time attributes added to the object.


dody