[Zope] Changing a COPY of metadata modifies ZClass instance?
Milos Prudek
milos.prudek@tiscali.cz
Mon, 25 Mar 2002 14:31:50 +0100
>>This problem applies to lists only... a simple assignment seems to
>>assign a reference to original variable instead of creating a copy of
>>original variable data.
>>Is this normal Python behaviour?
> this is essential python behaviour.
OK. Thank you for your help, Hans!
> AND: from copy import copy, deepcopy.
Good tip. It is also possible to assign "y=x[0:]", and voila, y is data
copy, not a reference, and it is independent.
--
Milos Prudek