Open thomaspouncy opened 6 years ago
Are cdef classes picklable by default with the pickle module from the standard library?
If not there is no way cloudpickle can do it automatically for you. I guess you need to implement a a __reduce__
method or the __getstate__
/ __setstate_
method pair.
I'm not sure if this is a known limitations of cloud pickle that I was unaware of, but I haven't been able to get cloud pickle to pickle/unpickle instances of very basic cython-compiled classes.
If I have a TestClass.pyx file with the following content:
, then compile that to a TestClass.so file with cython and run the following:
, everything works just fine. However, if I change TestClass to a cdef class:
, and recompile, I get the following error
If I add any methods to this cdef class, like so:
, then I get the following error:
Finally, if I add an init method to my cdef class:
, I get this error:
Are all of these just known limitations of cloudpickle, or should this be working? I am using: cloudpickle==0.5.3 cython==0.28.3 python==2.7.13
Thanks!