You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Expose CloudPickler as Pickler instead of pickle.Pickler #366
oh, I didn't see that - thank you! I can make a PR this weekend.
So the idea is to simply add a FutureWarning for now when someones tries to use Cloudpickle.Pickler. And after two more releases, we can then merge #235 .
I closed my PR: master has changed quite a bit and I was still not able to figure out the python < 3.7 part.
It seems that there is now a way simpler solution for this problem since cloudpickle.Pickler is not defined anymore: we could simply define cloudpickle.Pickler = cloudpickle.CloudPickler in the init file. Does that sound like a good solution?
Indeed we broke the backward compat without realizing it :(
Therefore what you suggest seems fine. We should probably add some tests, make it explicit that this is the new correct way to use the library by updating the README and then later we will deprecate the CloudPickler class (but not before we drop Python 3.6 compat so that we can use module level __getattr__ to issue the deprecation warning).
I skimmed the tests, they don't seem to directly refer to cloudpickle.CloudPickler anywhere. Most calls are just cloudpickle.dump(). Which tests do you think will be needed?
Something like assert hasattr(cloudpickle, "Pickler") and cloudpickle.Pickler is cloudpickle.CloudPickler is a good start. This should prevent our future selves from mistakenly removing these lines.
Activity
ogrisel commentedon May 20, 2020
This was already discussed in #235. We would have to go through a
FutureWarningphase for 2 releases (using module-levelgetattr).Someone has to do it though. Would you be interested in submitting a PR?
twoertwein commentedon May 20, 2020
oh, I didn't see that - thank you! I can make a PR this weekend.
So the idea is to simply add a
FutureWarningfor now when someones tries to useCloudpickle.Pickler. And after two more releases, we can then merge #235 .twoertwein commentedon Jul 20, 2020
I closed my PR: master has changed quite a bit and I was still not able to figure out the python < 3.7 part.
It seems that there is now a way simpler solution for this problem since
cloudpickle.Pickleris not defined anymore: we could simply definecloudpickle.Pickler = cloudpickle.CloudPicklerin the init file. Does that sound like a good solution?ogrisel commentedon Aug 11, 2020
Indeed we broke the backward compat without realizing it :(
Therefore what you suggest seems fine. We should probably add some tests, make it explicit that this is the new correct way to use the library by updating the README and then later we will deprecate the
CloudPicklerclass (but not before we drop Python 3.6 compat so that we can use module level__getattr__to issue the deprecation warning).twoertwein commentedon Aug 11, 2020
I skimmed the tests, they don't seem to directly refer to
cloudpickle.CloudPickleranywhere. Most calls are justcloudpickle.dump(). Which tests do you think will be needed?pierreglaser commentedon Aug 11, 2020
Something like
assert hasattr(cloudpickle, "Pickler") and cloudpickle.Pickler is cloudpickle.CloudPickleris a good start. This should prevent our future selves from mistakenly removing these lines.twoertwein commentedon Aug 12, 2020
thanks @pierreglaser I added that test to #392.
The README does not mention
cloudpickle.CloudPickler. For people following the README, there shouldn't be any change necessary.py-cloudpickle: updated to 2.0.0