[ZODB-Dev] __setstate__ and mixins
Jeremy Hylton
jeremy@alum.mit.edu
Mon, 7 Oct 2002 19:48:50 -0400
>>>>> "CR" == Christian Reis <kiko@async.com.br> writes:
CR> On Mon, Oct 07, 2002 at 07:23:32PM -0400, Jeremy Hylton wrote:
>> The Persistent base class defines a default __getstate__().
>> Whether it gets called or one of your methods gets called depends
>> on the method resolution order.
CR> You mean a default __setstate__(), I guess. Does it do anything
CR> useful?
Right. It provides both methods, and they implement the standard
protocol; e.g. getstate does not return _v_ attributes.
CR> As far as I can understand cPersistence.c, it just does basic
CR> sanity checking, right?
It provides the implementation.
Regardless, it means that if you have a chain of inheritance that goes
derived class -> Persistent -> base class, then you're base class's
__setstate__() isn't going to be called.
jeremy