[ZODB-Dev] Python properties on Persistent objects

Jim Fulton jim at zope.com
Thu Dec 17 07:21:40 EST 2009

On Wed, Dec 16, 2009 at 7:12 PM, Mikko Ohtamaa <mikko at redinnovation.com> wrote:
> I need to have little clarification should properties work on
> Persistent objects.

Properties work with persistent objects with one limitation that I'm aware of.
The __setattribute__ method used by the persistent base class assumes
that any attribute assignment modifies the object's persistent state.
A property
that doesn't modify state or that modifies volatile state will fool
it. Conceivably,
one could override __setattribute__ to handle such properties, but doing so
would require great care. I don't recommend it.


Jim Fulton

More information about the ZODB-Dev mailing list