marshal vs pickle

Evan Klitzke evan at yelp.com
Wed Oct 31 08:31:38 CET 2007


The documentation for marshal makes it clear that there are no
guarantees about being able to correctly deserialize marshalled data
structures across Python releases. It also implies that marshal is not
a general "persistence" module. On the other hand, the documentation
seems to imply that marshalled objects act more or less like pickled
objects.

Can anyone elaborate more on the difference between marshal and
pickle. In what conditions would using marshal be unsafe? If one can
guarantee that the marshalled objects would be created and read by the
same version of Python, is that enough?

-- 
Evan Klitzke <evan at yelp.com>



More information about the Python-list mailing list