Andy Terrel <[EMAIL PROTECTED]> writes:

> I just need to keep the state around. I make a call to some function
> that is pretty expensive so I want to save it as a member during the
> __init__ of the decorator.
>
> Yeah I'm afraid it can't be done either, that's why I asked the group.

Have you looked at memoize decorators?  They seem to do what you want.
There are examples at the Python website (some link in there, I'm
sorry...).

This will give you lots of resources, including full recipes and
comments from the Python cookbook:
http://www.google.com.br/search?q=python+decorator+memoize


-- 
Jorge Godoy      <[EMAIL PROTECTED]>
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to