[ZODB-Dev] Computed Attributes and property's

Dieter Maurer dieter at handshake.de
Wed May 18 16:55:04 EDT 2005


Stephen Masterman wrote at 2005-5-17 15:55 -0400:
> ...
>Does ZODB have something equivalent to Durus' Computed Attributes? Which
>I understand are attributes (or methods) on a Persistent object that
>compute a value from some other attributes and then cache that result
>for each connection, and if any of the attributes from which the
>Computed Attribute computes its result change, the new result will be
>automatically computed and all connections will have their cached value
>invalidated.

Oneone else already pointed out "ComputedAttribute".
It does neither automatic caching nor is there any support
for modification notifications.

> ... "__getattr__"
>and I know the ZODB docs warn against messing
>with those functions for Persistent classes.

"__getattr__" is still very dangerous -- especially when it handles acquisition
wrapped objects.
But Jim removed the explicit problem related to persistent objects
a long time ago. Only the general dangers for "__getattr__" remain.

-- 
Dieter


More information about the ZODB-Dev mailing list