On Tue, 12 Jan 2021 at 17:16, Christopher Barker <python...@gmail.com> wrote: > > Is the implementation of lru_cache too opaque to poke into it without an > existing method? Or write a quick monkey-patch? > > Sorry for not checking myself, but the ability to do that kind of thing is > one of the great things about a dynamic open source language.
I've only looked at the Python implementation, but the cache is a local variable in the wrapper, unavailable from outside. The cache information function is a closure that references that local variable, assigned as an attribute of the wrapped function. It's about as private as it's possible to get in Python (not particularly because it's *intended* to hide anything, as far as I can tell, more likely for performance or some other implementation reason). Paul _______________________________________________ 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/C6YULKSV5RV36WSWMGKWPMLUFDL7YN2Y/ Code of Conduct: http://python.org/psf/codeofconduct/