:mod:`marshal` --- Serialize Python objects =========================================== .. module:: marshal :synopsis: Serialize Python objects This module implements a subset of the corresponding :term:`CPython` module, as described below. For more information, please refer to the original CPython documentation: `marshal `_ This module implements conversion between Python objects and a binary format. The format is specific to MicroPython, but it does not depend on the machine architecture, so data can be transferred and used between different MicroPython instances as long as the version of the binary data matches (the current version is the same as the .mpy file version; see MicroPython .mpy files). Functions ~~~~~~~~~ .. function:: marshal.dumps(value, /) Convert the given value to binary format and return the corresponding bytes object. Currently, code objects are the only supported values that can be converted. .. function:: marshal.loads(data, /) Convert the given bytes-like data to the corresponding Python object and return it.