cannot pickle code example
Example: cannot pickle
You can't pickle class instances with pickle or cPickle , but you can with dill . ... Also better than your class having a dump and load method, you might just use dump and load from dill directly... then if you are doing something complicated, you can still add a __getstate__ and __setstate__ method