[Python-Dev] Cached Property Pattern

Fred L. Drake, Jr. fdrake at acm.org
Fri Dec 29 20:04:50 CET 2006


On Friday 29 December 2006 10:50, Oleg Broytmann wrote:
 >    I don't remember any resolution. I think submitting a small module to
 > the patch tracker would be the simplest way to revive the discussion.

We have a handful of interesting descriptors we use for Zope 3 development:

    http://svn.zope.org/Zope3/trunk/src/zope/cachedescriptors/

I find I use the Lazy property quite a bit in short-lived contexts (a single 
web request); this sounds very much like what's being described here.  The 
readproperty is probably better when the computation isn't so expensive and 
the value may need to be re-computed frequently anyway.


  -Fred

-- 
Fred L. Drake, Jr.   <fdrake at acm.org>


More information about the Python-Dev mailing list