[Python-3000] Simplifying pickle for Py3k

Alexandre Vassalotti alexandre at peadrop.com
Thu Oct 4 08:49:16 CEST 2007


On 10/3/07, Neil Schemenauer <nas at arctrix.com> wrote:
> I guess the library overhaul hasn't really started it but it would
> be nice if the pickle module could get some work.  Today I'm trying
> to efficiently store a class using pickle

Could you elaborate on what you are trying to do?

> and the documentation is making my head hurt.  I don't think the
> documentation itself is the problem, just the fact that the rules
> are so complicated.
>
> I guess there are several different solutions:
>
>     * Remove backwards compatible stuff from the code and the
>       documentation.  The downside is that old pickles could not be
>       loaded.  Perhaps that's not a huge issue since the removal of
>       old-style classes might already break old pickles.
>

This would not simplify the pickle module by much. So, I don't think
this would justify breaking backward-compatibility.

As far as I know, the removal of the old-style classes does not break
old pickle streams, since the code of classes is not pickled but
referenced.

>     * Remove the backwards compatible stuff from the documentation
>       only.  The would help people using the language but would
>       still be a long term maintenance issue.

The documentation for the pickle module is completely outdated and
confusing. In fact, some sections are outright wrong about how the
current module works. If I get some free time (which is unlikely,
right now), I will update the documentation.

>     * Leave the old code in but generate warnings when old pickle
>       mechanisms are used.  Eventually the old stuff could be
>       removed from the code.

Could point out specific examples of the "old code" that you are referring to?

>     * Provide an "oldpickle" module the supports pre-3k pickles.

As I said, old pickle streams should work fine with Py3k. So, adding
yet another pickle module is unnecessary.

-- Alexandre


More information about the Python-3000 mailing list