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 <[email protected]> wrote: > On Fri, 16 Oct 2020 11:34:08 +0300 > Ram Rachum <[email protected]> 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 -- [email protected] > To unsubscribe send an email to [email protected] > https://mail.python.org/mailman3/lists/python-ideas.python.org/ > Message archived at > https://mail.python.org/archives/list/[email protected]/message/URI4SA24RFQDMIJXAQRYBPQUCQPW2YRS/ > Code of Conduct: http://python.org/psf/codeofconduct/ >
_______________________________________________ Python-ideas mailing list -- [email protected] To unsubscribe send an email to [email protected] https://mail.python.org/mailman3/lists/python-ideas.python.org/ Message archived at https://mail.python.org/archives/list/[email protected]/message/GGXL5SELZCIMOFAHNSH4ALH5Q4SU6ADZ/ Code of Conduct: http://python.org/psf/codeofconduct/
