[Grok-dev] Persistence issue with grok.Model

Brandon Craig Rhodes brandon at rhodesmill.org
Fri Jan 2 15:31:09 EST 2009


Martijn Faassen <faassen at startifact.com> writes:

> I wonder why the ZODB is not able to perceive a __dict__ access as an
> attribute access, however.

The definition of Python itself specifies that ``myobject.__dict__``
does a *direct* return of the object dictionary, without invoking *any*
of the attribute-getting machinery of the class or metaclass.  This is
necessary so that classes and metaclass methods themselves can somehow
bypass themselves and get to the "real" instance variables!

So the ZODB cannot intercept ``__dict__`` because, well, nobody can. :-)

-- 
Brandon Craig Rhodes   brandon at rhodesmill.org   http://rhodesmill.org/brandon


More information about the Grok-dev mailing list