On Fri, 16 Oct 2020 11:34:08 +0300
Ram Rachum <r...@rachum.com> wrote:
> Did you mean like keeping a hidden attribute on the object with the result?
> Well, that'd require manually keeping track of these attributes for each
> method I'm caching. I do that sometimes, but it's verbose.

You can write a decorator that does that, generating the hidden
attribute name based on the decorated function name and module.

Regards

Antoine.

_______________________________________________
Python-ideas mailing list -- python-ideas@python.org
To unsubscribe send an email to python-ideas-le...@python.org
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at 
https://mail.python.org/archives/list/python-ideas@python.org/message/URI4SA24RFQDMIJXAQRYBPQUCQPW2YRS/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to