Hacker News new | ask | show | jobs
by khaledh 821 days ago
I was going to mention this as well. It's fairly similar:

  memory = joblib.memory.Memory(...)
  
  @memory.cache
  def slow_func(...):
      ...
1 comments

The diskcache docs state:

""" Caching Libraries

    joblib.Memory provides caching functions and works by explicitly saving the inputs and outputs to files. It is designed to work with non-hashable and potentially large input and output data types such as numpy arrays.
""" From https://pypi.org/project/diskcache/
This is great! I see it also supports an 'ignore' parameter.