python-diskcache icon indicating copy to clipboard operation
python-diskcache copied to clipboard

[Feature Request] Support dill

Open schmoelder opened this issue 3 years ago • 2 comments

Due to the standard library's limitation to serialize many data types using pickle, I unfortunately cannot currently use python-diskcache in my research.

Dill is a python library which expands python's pickle module for serializing and de-serializing to the majority of the built-in python types including lambda functions.

I understand that python-diskcache is pure python only but since dill provides the user the same interface as the pickle, making it optional could be an option. All that would be required would be import dill as pickle. See also a working prototype: https://github.com/schmoelder/python-diskcache/tree/support_dill

schmoelder avatar Jul 02 '22 07:07 schmoelder

Create a custom Disk data type. See the docs at https://grantjenks.com/docs/diskcache/tutorial.html#disk

grantjenks avatar Jul 02 '22 16:07 grantjenks

Ok, thanks for the tip! It's quite a bit of boilerplate in comparison but seems to work.

schmoelder avatar Jul 24 '22 08:07 schmoelder