Good question, this is slightly different than lru_cache in that it persists to disk so it retrieves from the cache even when you rerun the Python interpreter.
Also it gives you a bit of flexibility as when to refresh the cache and to use or ignore function parameters. I often make a change in one 'group', db data for example, and am able to just refresh those methods that gather data from the db.
3 comments
[ 1.1 ms ] story [ 20.3 ms ] threadNot something I seen, a decorator used only for development that is deployed in production.
Thoughts?
Can you go a bit more into detail as to why I would pick this over functional.lru_cache?
Good question, this is slightly different than lru_cache in that it persists to disk so it retrieves from the cache even when you rerun the Python interpreter.
Also it gives you a bit of flexibility as when to refresh the cache and to use or ignore function parameters. I often make a change in one 'group', db data for example, and am able to just refresh those methods that gather data from the db.