There used to be cPickle
in python2.7. However, I don't see it anymore in python3 pickle
. What ever happened to that module, did it get merged into the regular pickle
module?
-
1yes they are one and the same now – anthony sottile Nov 21 '20 at 05:44
-
@AnthonySottile I see, thanks for the feedback. Is there any place in the docs or proposals where they mention that? – David542 Nov 21 '20 at 05:45
-
1[PEP 3108](https://www.python.org/dev/peps/pep-3108/) – anthony sottile Nov 21 '20 at 05:46
1 Answers
In Python 2.7 there was a pure Python version and a performance optimized cPickle
implemented in C. Now, only the latter implementation stayed but with the simpler name.
This name-unification approach started with Python 3. Please see an excerpt from "What's new in Python 3" by Guido var Rossum:
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.

- 14,672
- 11
- 46
- 75