O'Reilly logo

Python: Essential Reference, Third Edition by David Beazley

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

marshal

The marshal module is used to serialize Python objects in an “undocumented” Python-specific data format. marshal is similar to the pickle and shelve modules, but it is less powerful and intended for use only with simple objects. It shouldn’t be used to implement persistent objects in general (use pickle instead).

dump(value, file [, version])

Writes the object value to the open file object file. If value is an unsupported type, a ValueError exception is raised. version is an integer that specifies the data format to use. The default output format is found in marshal.version and is currently set to 1. Version 0 is an older format used by earlier versions of Python.

dumps(value [, version])

Returns the string written by the dump() function. ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required