Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document differences between pickle and safepickle #3

Open
mattdodge opened this issue Apr 20, 2017 · 1 comment · May be fixed by #13
Open

Document differences between pickle and safepickle #3

mattdodge opened this issue Apr 20, 2017 · 1 comment · May be fixed by #13

Comments

@mattdodge
Copy link
Collaborator

It would be nice to have a comparison of the things (i.e., data types) that are picklable but not safepicklable. If there are any vice versa then we could document those too.

@f1401martin
Copy link
Contributor

The following types can be pickled (taken from python's pickle documentation):

  • None, True, and False
  • integers, floating point numbers, complex numbers
  • strings, bytes, bytearrays
  • tuples, lists, sets, and dictionaries containing only picklable objects
  • functions defined at the top level of a module (using def, not lambda)
  • built-in functions defined at the top level of a module
  • classes that are defined at the top level of a module
  • instances of such classes whose dict or the result of calling getstate() is picklable (see section Pickling Class Instances for details).

In contrast, safepickle currently does not save:

  • complex numbers
  • functions defined at the top level of a module (using def, not lambda)
  • built-in functions defined at the top level of a module
  • classes that are defined at the top level of a module
  • instances of such classes whose the result of calling getstate() is picklable

@tlugger tlugger linked a pull request Oct 25, 2018 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants