Well, I can also write a decorator that does lru_cache, but there are a lot
of advantages that it's available in the standard library...
On Fri, Oct 16, 2020 at 12:35 PM Antoine Pitrou
On Fri, 16 Oct 2020 11:34:08 +0300 Ram Rachum
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-leave@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/URI4SA... Code of Conduct: http://python.org/psf/codeofconduct/