Object copying itself
Dale Strickland-Clark
dale at riverhall.NOTHANKS.co.uk
Fri Feb 15 13:58:05 EST 2002
I have an object which is just data and an __init__ to set up some
defaults.
Now I need to allow __init__ to get the defaults from another instance
of itself if passed as an argument.
Most of the values are simple numerics and a few object references but
there are also a couple of lists.
I want object references copied (shallow copy) but the lists need to
be copied entirely (deep copy).
Do I have to do this by hand or is there a neat way of doing it?
Ta very much.
--
Dale Strickland-Clark
Riverhall Systems Ltd
More information about the Python-list
mailing list