[Python-ideas] functools.lru_cache manual cache modification

Constantin Berhard constantin at exxxtremesys.lu
Wed Dec 3 23:41:36 CET 2014

On 03.12.2014 23:33, Ethan Furman wrote:
> On 12/03/2014 02:24 PM, Constantin Berhard wrote:
>> On 03.12.2014 22:22, Andrew Barnert wrote:
>> I need this to make my decorator compatible with lru_cache.
>> <https://titania.fs.uni-saarland.de/projects/libtco>
>> It's only 27 lines of code, you may read it if you want to understand my
>> problem. (additionally 62 lines of example code)
> I think you are missing the point:  the internals are not going be made public; you need to write your own custom lru_cache.

I don't need or want an lru_cache. I want people, who want to use my
library, to be able to use the standard functools together with my lib.
So I want to become compatible with lru_cache.

Of course, I could provide a special version of an lru cache, which is
tuned to work well with my library, but I regard that solution as unelegant.


More information about the Python-ideas mailing list