-
-
Notifications
You must be signed in to change notification settings - Fork 189
Closed
Labels
Milestone
Description
I am getting an error trying to serialize objects of a certain custom class that where previously serialized and de-serialized by cloudpickle (in practice, they are created by dask workers). Here is an example, with some comments below.
import cloudpickle
class A(object):
pass
class B(A):
def foo(self):
super()
NewB = cloudpickle.loads(cloudpickle.dumps(B))
b = NewB()
import dill
dill.dumps(b)This produces an error:
_pickle.PicklingError: Can't pickle <class '__main__.B'>: it's not the same object as __main__.B
Full stack trace: gist.
The error does not happen in either of the following cases:
- the classes are imported from a module;
- class
Bdoesn't usesuper(), i.e. if it's defined like this:
class B(A):
def foo(self):
A()
B()Versions:
python - 3.5.2
cloudpickle - 0.4.0
dill - 0.2.7.1
Reactions are currently unavailable