[Python-Dev] Pickle alternative in stdlib (Was: On breaking modules into packages)
Jesus Cea
jcea at jcea.es
Fri Nov 5 02:31:05 CET 2010
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On 04/11/10 15:57, Alexander Belopolsky wrote:
> On Thu, Nov 4, 2010 at 10:51 AM, Guido van Rossum <guido at python.org> wrote:
> ..
>>>> Twisted actually tried to preserve pickle compatibility in the bad old days,
>>>> but it was impossible. Pickles should never really be saved to disk unless
>>>> they contain nothing but lists, ints, strings, and dicts.
>>
>> But *that* set of types can safely be marshalled using the marshal module...
>
> Not if the instances contain reference cycles.
Moreover, in the docs the marshall module EXPLICITLY says that the
format is undocumented on purpose, and subject to change. Seems a pretty
bad option for persistence, if you expect to read your data back in the
future.
http://docs.python.org/library/marshal.html
"""
This module contains functions that can read and write Python values in
a binary format. The format is specific to Python, but independent of
machine architecture issues (e.g., you can write a Python value to a
file on a PC, transport the file to a Sun, and read it back there).
Details of the format are undocumented on purpose; it may change between
Python versions (although it rarely does).
"""
- --
Jesus Cea Avion _/_/ _/_/_/ _/_/_/
jcea at jcea.es - http://www.jcea.es/ _/_/ _/_/ _/_/ _/_/ _/_/
jabber / xmpp:jcea at jabber.org _/_/ _/_/ _/_/_/_/_/
. _/_/ _/_/ _/_/ _/_/ _/_/
"Things are not so easy" _/_/ _/_/ _/_/ _/_/ _/_/ _/_/
"My name is Dump, Core Dump" _/_/_/ _/_/_/ _/_/ _/_/
"El amor es poner tu felicidad en la felicidad de otro" - Leibniz
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
iQCVAwUBTNNeWZlgi5GaxT1NAQLU/wP/aZOJkgYWHyYMUT0diDsh+pFg6TxDPWMu
/cNx5l6wNaW8DQ5cuMSHkelfVYpx6EQwTCZPu9jiAAOJmFfNURt1Q+P4ikf5eobA
7mRlFrr+C3Lmi9CA3thuwBh4IkLHUl3mk6eQ0mqJPzpdbJLWhPmkOEN7L31nk9//
YQHdU4e795U=
=+cB0
-----END PGP SIGNATURE-----
More information about the Python-Dev
mailing list