[ZODB-Dev] copy.copy on Persistent object (ExtensionClass) fails.

Thomas Guettler hv at tbz-pariv.de
Fri May 7 03:17:08 EDT 2004


Am Donnerstag, 6. Mai 2004 21:08 schrieb Dieter Maurer:
> Syver Enstad wrote at 2004-5-6 00:31 +0200:
> >How do I copy a Persistent object (I am using ZODB 3.2).
>
> You can use pickling to get an unsharing deep copy.
>
> 	from cPickle import loads, dumps
>
> 	copy = loads(dumps(obj,1))
>
> Be warned, however, that this uses undocumented implementation
> details of "dumps" that are not garanteed to always work
> and may change across Python distributions.

Hi Dieter and others,

what happens to obj._p_oid, does copy get the same?

 Thomas




More information about the ZODB-Dev mailing list