Page MenuHomeSolus

Update python-cloudpickle to 1.6.0
ClosedPublic

Authored by algent on Sun, Sep 6, 8:08 PM.

Details

Summary

Changelog:

  • cloudpickle's pickle.Pickler subclass (currently defined as cloudpickle.cloudpickle_fast.CloudPickler) can and should now be accessed as cloudpickle.Pickler. This is the only officially supported way of accessing it.
  • cloudpickle now supports pickling dict_keys, dict_items and dict_values.

Signed-off-by: Algent Albrahimi <algent@protonmail.com>

Test Plan
  • Update python-spyder-kernels against this version.
  • Run a few python scripts using spyder3.
  • Run this example using cli:
>>> import cloudpickle
>>> squared = lambda x: x ** 2
>>> pickled_lambda = cloudpickle.dumps(squared)
>>> import pickle
>>> new_squared = pickle.loads(pickled_lambda)
>>> new_squared(2)
4
>>> CONSTANT = 42
>>> def my_function(data: int) -> int:
...     return data + CONSTANT
... 
>>> pickled_function = cloudpickle.dumps(my_function)
>>> depickled_function = pickle.loads(pickled_function)
>>> depickled_function(43)
85
>>>

Diff Detail

Repository
R3930 python-cloudpickle
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

algent created this revision.Sun, Sep 6, 8:08 PM
algent requested review of this revision.Sun, Sep 6, 8:08 PM
algent updated this revision to Diff 23112.

remove extra spaces

JoshStrobl accepted this revision.Wed, Sep 9, 2:05 PM
JoshStrobl added a subscriber: JoshStrobl.

LGTM, thanks!

This revision is now accepted and ready to land.Wed, Sep 9, 2:05 PM
This revision was automatically updated to reflect the committed changes.