
April 30, 2009
1:06 a.m.
On Wed, Apr 29, 2009 at 10:33:27PM +0000, Benjamin Peterson wrote:
I think it would be nice to add a "cache" argument to the property() constructor. When "cache" was True, property would only ask the getter function once for the result. This would simplify properties that require expensive operations to compute.
http://ppa.cvs.sourceforge.net/viewvc/*checkout*/ppa/QPS/qps/qUtils.py See class CachedAttribute. Just use @CachedAttribute instead of @property. Oleg. -- Oleg Broytmann http://phd.pp.ru/ phd@phd.pp.ru Programmers don't die, they just GOSUB without RETURN.