Sections
Personal tools
You are here: Home » Faculty and Staff » Hale, Walker » November 15 » Lazy Attributes
 

Lazy Attributes

An example recipe. Here a custom descriptor and metaclass allow you to define a class with attributes that will only be computed when needed. When the value is finally computed, it is stored in the object.

The link address is: http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/131495

Added by walker.hale
Last modified 2006-11-24 05:09 PM