February 2006
Intermediate to advanced
648 pages
14h 53m
English
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. ...