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

pickle import #68

Open
martinberoiz opened this issue Nov 23, 2020 · 0 comments
Open

pickle import #68

martinberoiz opened this issue Nov 23, 2020 · 0 comments

Comments

@martinberoiz
Copy link
Member

If I understand correctly, apparently since python 3.0 pickle/cpickle is just pickle.

A common pattern in Python 2.x is to have one version of a module implemented in pure Python, with an optional accelerated version implemented as a C extension; for example, pickle and cPickle. This places the burden of importing the accelerated version and falling back on the pure Python version on each user of these modules. In Python 3.0, the accelerated versions are considered implementation details of the pure Python versions. Users should always import the standard version, which attempts to import the accelerated version and falls back to the pure Python version. The pickle / cPickle pair received this treatment.

So these lines

try:
import cPickle as pickle # noqa
except ImportError:
import pickle

Should be just

import pickle
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

No branches or pull requests

1 participant