Show More
@@ -519,6 +519,12 b' class DirectView(View):' | |||
|
519 | 519 | pickleutil.use_dill() |
|
520 | 520 | return self.apply(pickleutil.use_dill) |
|
521 | 521 | |
|
522 | def use_cloudpickle(self): | |
|
523 | """Expand serialization support with cloudpickle. | |
|
524 | """ | |
|
525 | pickleutil.use_cloudpickle() | |
|
526 | return self.apply(pickleutil.use_cloudpickle) | |
|
527 | ||
|
522 | 528 | |
|
523 | 529 | @sync_results |
|
524 | 530 | @save_ids |
@@ -68,6 +68,26 b' def use_dill():' | |||
|
68 | 68 | # disable special function handling, let dill take care of it |
|
69 | 69 | can_map.pop(FunctionType, None) |
|
70 | 70 | |
|
71 | def use_cloudpickle(): | |
|
72 | """use cloudpickle to expand serialization support | |
|
73 | ||
|
74 | adds support for object methods and closures to serialization. | |
|
75 | """ | |
|
76 | from cloud.serialization import cloudpickle | |
|
77 | ||
|
78 | global pickle | |
|
79 | pickle = cloudpickle | |
|
80 | ||
|
81 | try: | |
|
82 | from IPython.kernel.zmq import serialize | |
|
83 | except ImportError: | |
|
84 | pass | |
|
85 | else: | |
|
86 | serialize.pickle = cloudpickle | |
|
87 | ||
|
88 | # disable special function handling, let cloudpickle take care of it | |
|
89 | can_map.pop(FunctionType, None) | |
|
90 | ||
|
71 | 91 | |
|
72 | 92 | #------------------------------------------------------------------------------- |
|
73 | 93 | # Classes |
General Comments 0
You need to be logged in to leave comments.
Login now