It's alwys helpful if you can include a self contained example so it's easy
to figure out exactly what you are getting at. I say that because I'm not
entirely sure of the context here -- it appears that this is not numpy
related issue at all, but rather a general python question. If so, I think
what you are looking for is copy.deepcopy. As it name implies it does a deep
copy of an object as opposed to a shallow copy, which is what
copy.copydoes. If that doesn't do what you want or I misunderstood
your question,
please supply some more detail.
On 5/13/07, dmitrey <[EMAIL PROTECTED]> wrote:
hi all,
does anyone know howto copy an instance of class, that contains multiple
subfields, for example
myObj.field1.subfield2 = 'asdf'
myObj.field4.subfield8 = numpy.mat('1 2 3; 4 5 6')
I tried
from copy import copy
myObjCopy = copy(myObj)
but it seems that it doesn't work correctly
Thx, D.
_______________________________________________
Numpy-discussion mailing list
[email protected]
http://projects.scipy.org/mailman/listinfo/numpy-discussion
--
//=][=\\
[EMAIL PROTECTED]
_______________________________________________
Numpy-discussion mailing list
[email protected]
http://projects.scipy.org/mailman/listinfo/numpy-discussion