[Zope-dev] Re: Refresh trashes acquisition

Ross Boylan RossBoylan@stanfordalumni.org
Thu, 8 Aug 2002 21:32:42 -0700


I missed this in all the excitement, and have a follow-up below.
On Tue, Jul 30, 2002 at 04:57:07PM +0000, Florent Guillaume wrote:
> Ross Boylan  <RossBoylan@stanfordalumni.org> wrote:
> > My case was, however, subtly different.  a.__of__(b) got put in a
> > PersistentList, which is essentially [] with a little extra help:
> > # This code is a copy of the Python UserList.py, updated to support
> > # persistence.
> > 
> > from Persistence import Persistent
> > 
> > 
> > class PersistentList (Persistent):
> > 
> >     isAPersistentList = 1
> >     
> >     def __init__(self, lst=None):
> >         if lst is None:
> >             self.data = []
> >         else:
> >             self.data = list(lst)
> 
> This is not a correct PersistentList. Your object won't get stored to
> ZODB upon l.append(xx) or l.update.
> 
> There is a correct PersistentList in the ZODB package of Zope 2.6 (in
> CVS).
> 
> Florent
> 

That was just the first few lines of the class definition to give a
flavor.  Was your remark that it was wrong based on the assumption it
was the entire implementation, or is there something obviously wrong
with the part you see?