[ZODB-Dev] __setstate__ and mixins

Christian Reis kiko@async.com.br
Mon, 7 Oct 2002 19:54:22 -0300


If I have a class hierarchy like:

    class Foo:
        def __setstate__(self, state):
            pass

    class Bar(Persistence.Persistent):
        pass

    class Baz(Foo, Bar):
        pass

I see that __setstate__() is never called for instances of Baz() being
unghostify()ed, but if I move it to Bar(), it works perfectly. Is this
by design, and if so, is it noted in the docs?  I just wasted^Wspent
some time discovering this, and thought it a bit odd.

How does cPersistence know it has to call __setstate__ in it's side of
the hierarcy?

Take care,
--
Christian Reis, Senior Engineer, Async Open Source, Brazil.
http://async.com.br/~kiko/ | [+55 16] 261 2331 | NMFL