Store the cache to a file functools.lru_cache in Python >= 3.2

前端 未结 4 617
清歌不尽
清歌不尽 2020-12-14 01:03

I\'m using @functools.lru_cache in Python 3.3. I would like to save the cache to a file, in order to restore it when the program will be restarted. How could I

4条回答
  •  南笙
    南笙 (楼主)
    2020-12-14 01:32

    Consider using joblib.Memory for persistent caching to the disk.

    Since the disk is enormous, there's no need for an LRU caching scheme.

提交回复
热议问题