[ZODB-Dev] PersistentMapping copy
Joshua Reynolds
joshuar@isogen.com
Wed, 16 Jan 2002 10:23:10 -0600
Sorry, I have the latest "StandaloneZODB" checkout. The problem is this:
User dict's copy defaults to using the copy module's copy() function for
all subclasses.
If the thing your trying to copy doesn't have a __copy__ method
(PersistentMapping doesn't) the copy function fall down go boom with an
un(shallow)copyable Error.
Joshua
Jeremy Hylton wrote:
>>>>>>"JR" == Joshua Reynolds <joshuar@isogen.com> writes:
>>>>>>
>
> JR> Is there any compelling reason not to have a copy method on
> JR> PersistentMapping? I am trying to update to the latest ZODB and
> JR> i see that it is gone. I was thinking something along the lines
> JR> of
>
> JR> def __copy__(self):
> JR> return PersistentMapping(self.data.copy())
>
> What version of ZODB are you refering to? The code on the Zope trunk
> now extends UserDict. UserDict defines a copy() method.
>
> Jeremy
>
>
>
>
--
Joshua Reynolds | IT
Isogen International
Office: 512-380-0347
Cell: 512-743-3865
1016 La Posada Suite 240
Austin, TX 78752