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! ;)


Florent Guillaume, Nuxeo (Paris, France)   CTO, Director of R&D
+33 1 40 33 71 59   http://nuxeo.com   [EMAIL PROTECTED]
For more information about ZODB, see the ZODB Wiki:

ZODB-Dev mailing list  -  ZODB-Dev@zope.org

Reply via email to