[Python-3000] Simplifying pickle for Py3k

Barry Warsaw barry at python.org
Wed Oct 3 20:28:48 CEST 2007


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Oct 3, 2007, at 2:01 PM, Neil Schemenauer 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 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.

+1.  Try reverse engineering those rules if you really want to have  
some fun. ;)

> 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.
>
>     * 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.
>
>     * Leave the old code in but generate warnings when old pickle
>       mechanisms are used.  Eventually the old stuff could be
>       removed from the code.
>
>     * Provide an "oldpickle" module the supports pre-3k pickles.
>
> I think I like the warnings idea best.

I'm not sure about eventually removing the code, since we may need  
long term support for migration from 2.x pickles to 3.0 pickles.   
OTOH, if 2to3 or Python 2.6+ could include pickle migration code,  
that might be fine.

- -Barry

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (Darwin)

iQCVAwUBRwPfYXEjvBPtnXfVAQJfSwQAnoAmgSQy99rJz4C+hks0jvKZz5X3yNOa
qV9pV9942KEVZN5lwXLtzoWAnBr9MpXTjZ9AEmDgJVScSXV4Vk/MegsS/Q8R2diG
88x1vpuXQF333CHgWnGiQYw6lysZfP5rbKEHaOYwQB4mjLTS7VSKuZdVtZvvMGH8
7HDj3GqqC0I=
=1Plz
-----END PGP SIGNATURE-----


More information about the Python-3000 mailing list