[Zope] how much does changing a property add to data.fs??

Chris Withers chrisw@nipltd.com
Fri, 09 Nov 2001 08:23:51 +0000


Robert Rottermann wrote:
> 
> Is it only the changed attribute that is added to the end of data.fs or is
> the whole object copied???

Not as simple as that... it depends whether the attribute type subclasses
Persistent or not.

eg:

Take an object, x, whose class subclasses Persistent

x.a=1
x.b=PersistentMapping()

Now, doing:

x.a +=1

...would cause a whole copy of x to be appended to the Data.fs

doing:

x.b['fish']='halibut'

...would cause only a new copy of b to be added to the Data.fs

Unfortunately, because of the way they're implemented, properties behave like a
:-(

cheers,

Chris