[Python-ideas] caching properties

spir denis.spir at free.fr
Thu Apr 30 09:00:04 CEST 2009


Le Thu, 30 Apr 2009 13:57:07 +1000,
Steven D'Aprano <steve at pearwood.info> s'exprima ainsi:

> -1 on an extra parameter to property.
> 
> +1 on a cache decorator.
> 
> It is clear and simple enough to write something like:
> 
> @property
> @cache  # or "once" if you prefer the Eiffel name
> def value(self):
>     pass

I vote +1 for this version.
Cache and property are distinct features.

Denis
------
la vita e estrany



More information about the Python-ideas mailing list