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
Dill modifies python's pickler._Pickle.dispatch. This means it can clash with similar packages with similar goals, notably cloudpickle.
Dill does provide dill.extend to turn dill on and off, but this is cumbersome and relies on the user to be know when dill is or is not enabled.
Using a custom dispatch_table as specified in the Python's pickle documentation would be a cleaner implementation, in my opinion, as dill's extensions would be scoped only to dill and not clash with other packages polluting the global scope.
I haven't scoped the effort required, but I would be willing to assist if the maintainer(s) are willing to entertain such a change.
The text was updated successfully, but these errors were encountered:
dill made the choice to modify the contents of the pickle dispatch table, and unfortunately, cloudpickle made the same choice years later. So, yes, this causes potential clashes. One of the reasons this choice was made is historical, in that in python 2.x, pickle used a python dispatch table (and a pure python pickler) -- so, just by importing dill, one could augment the serialization of a package that is built to use pickle. In python 3.x, pickle uses a C pickler, so the augment of the _Pickle dispatch table is less impactful. Feel free to explore a PR along the lines you suggest.
Dill modifies python's pickler._Pickle.dispatch. This means it can clash with similar packages with similar goals, notably cloudpickle.
Dill does provide
dill.extend
to turn dill on and off, but this is cumbersome and relies on the user to be know when dill is or is not enabled.Using a custom dispatch_table as specified in the Python's pickle documentation would be a cleaner implementation, in my opinion, as dill's extensions would be scoped only to dill and not clash with other packages polluting the global scope.
I haven't scoped the effort required, but I would be willing to assist if the maintainer(s) are willing to entertain such a change.
The text was updated successfully, but these errors were encountered: