Function decorator that caches function results

George Sakkis gsakkis at
Sat Oct 8 20:37:38 CEST 2005

"Lasse Vågsæther Karlsen" <lasse at> wrote:

> [snip]
> Ok, so I thought, how about creating a decorator that caches the
> function results and retrieves them from cache if possible, otherwise it
> calls the function and store the value in the cache for the next invokation.
> [snip]

Cool, you re-invented the memoization pattern:

Yes, it's kinda discouraging that most interesting ideas have already been conceived, implemented
and used by others...<wink>


More information about the Python-list mailing list