[ZODB-Dev] Re: [Zope-dev] Re: sessions in the presence of conflicts

Florent Guillaume fg at nuxeo.com
Fri Dec 16 13:33:33 EST 2005


Tim Peters wrote:
> [Dennis Allison]
>>I have yet to figure out how to map a TransientObject "state" back
>>to the object it represents, but it clearly is possible.
> 
> I didn't see a response to that bit yet, so:  "the state" of an object P is
> whatever P.__getstate__() returns.  Given such a return value `state`, and
> some object Q of the same type as P, Q.__setstate__(state) gives Q the same
> state P had.  What state "means" is entirely up to the type's __setstate__()
> and __getstate__() implementations (if any).  Objects deriving from
> Persistent inherit (by default) implementations that retrieve and update an
> instance's __dict__.  BTrees.Length is a good example of a class that
> overrides these methods, using an integer as "the state".

Plagiarism! ;)
http://mail.zope.org/pipermail/zodb-dev/2005-December/009560.html

Florent

-- 
Florent Guillaume, Nuxeo (Paris, France)   CTO, Director of R&D
+33 1 40 33 71 59   http://nuxeo.com   fg at nuxeo.com


More information about the ZODB-Dev mailing list