marshal the marshal module is used to serialize python objects in an "undocumentedpython-specific data format marshal is similar to the pickle and shelve modulesbut it is less powerful and intended for use only with simple objects it shouldn' be used to implement persistent objects in general (use pickle insteadhoweverfor simple built-in typesthe marshal module is very fast approach for saving and loading data dump(valuefile [version]writes the object value to the open file object file if value is an unsupported typea 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 version is an older format used by earlier versions of python dumps(value [,version]returns the string written by the dump(function if value is an unsupported typea valueerror exception is raised version is the same as described previously load(filereads and returns the next value from the open file object file if no valid value is readan eoferrorvalueerroror typeerror exception will be raised the format of the input data is automatically detected loads(stringreads and returns the next value from the string string notes data is stored in binary architecture-independent format only noneintegerslong integersfloatscomplex numbersstringsunicode stringstupleslistsdictionariesand code objects are supported liststuplesand dictionaries can only contain supported objects class instances and recursive references in liststuplesand dictionaries are not supported integers may be promoted to long integers if the built-in integer type doesn' have enough precision--for exampleif the marshalled data contains -bit integerbut the data is being read on -bit machine marshal is not intended to be secure against erroneous or maliciously constructed data and should not be used to unmarshal data from untrusted sources marshal is significantly faster than picklebut it isn' as flexible pickle the pickle module is used to serialize python objects into stream of bytes suitable for storing in filetransferring across networkor placing in database this process is variously called picklingserializingmarshallingor flattening the resulting byte stream can also be converted back into series of python objects using an unpickling process lib fl ff