Closed ronkorving closed 1 year ago
Okay, nevermind. It already seems to do the trick. I guess functools.cache
uses lrucache
under the hood? :)
https://github.com/python/cpython/blob/3.9/Lib/functools.py#L652
def cache(user_function, /):
'Simple lightweight unbounded cache. Sometimes called "memoize".'
return lru_cache(maxsize=None)(user_function)
It's basically functools.partial()
on lru_cache
😄
I use
@cache
in places, and would love to use this plugin to clear those caches between tests. Is that something that has a place in this project?