{
    "mode": "pydoc",
    "parameter": "marshal",
    "section": "",
    "url": "https://www.chedong.com/phpMan.php/pydoc/marshal/json",
    "generated": "2026-06-02T13:21:29Z",
    "sections": {
        "NAME": {
            "content": "marshal\n",
            "subsections": []
        },
        "MODULE REFERENCE": {
            "content": "https://docs.python.org/3.10/library/marshal.html\n\nThe following documentation is automatically generated from the Python\nsource files.  It may be incomplete, incorrect or include features that\nare considered implementation detail and may vary between Python\nimplementations.  When in doubt, consult the module reference at the\nlocation listed above.\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "This module contains functions that can read and write Python values in\na binary format. The format is specific to Python, but independent of\nmachine architecture issues.\n\nNot all Python object types are supported; in general, only objects\nwhose value is independent from a particular invocation of Python can be\nwritten and read by this module. The following types are supported:\nNone, integers, floating point numbers, strings, bytes, bytearrays,\ntuples, lists, sets, dictionaries, and code objects, where it\nshould be understood that tuples, lists and dictionaries are only\nsupported as long as the values contained therein are themselves\nsupported; and recursive lists and dictionaries should not be written\n(they will cause infinite loops).\n\nVariables:\n\nversion -- indicates the format that the module uses. Version 0 is the\nhistorical format, version 1 shares interned strings and version 2\nuses a binary format for floating point numbers.\nVersion 3 shares common object references (New in version 3.4).\n\nFunctions:\n",
            "subsections": [
                {
                    "name": "dump",
                    "content": ""
                },
                {
                    "name": "load",
                    "content": ""
                },
                {
                    "name": "dumps",
                    "content": ""
                },
                {
                    "name": "loads",
                    "content": ""
                }
            ]
        },
        "FUNCTIONS": {
            "content": "",
            "subsections": [
                {
                    "name": "dump",
                    "content": "Write the value on the open file.\n\nvalue\nMust be a supported type.\nfile\nMust be a writeable binary file.\nversion\nIndicates the data format that dump should use.\n\nIf the value has (or contains an object that has) an unsupported type, a\nValueError exception is raised - but garbage data will also be written\nto the file. The object will not be properly read back by load().\n"
                },
                {
                    "name": "dumps",
                    "content": "Return the bytes object that would be written to a file by dump(value, file).\n\nvalue\nMust be a supported type.\nversion\nIndicates the data format that dumps should use.\n\nRaise a ValueError exception if value has (or contains an object that has) an\nunsupported type.\n"
                },
                {
                    "name": "load",
                    "content": "Read one value from the open file and return it.\n\nfile\nMust be readable binary file.\n\nIf no valid value is read (e.g. because the data has a different Python\nversion's incompatible marshal format), raise EOFError, ValueError or\nTypeError.\n\nNote: If an object containing an unsupported type was marshalled with\ndump(), load() will substitute None for the unmarshallable type.\n"
                },
                {
                    "name": "loads",
                    "content": "Convert the bytes-like object to a value.\n\nIf no valid value is found, raise EOFError, ValueError or TypeError.  Extra\nbytes in the input are ignored.\n"
                }
            ]
        },
        "DATA": {
            "content": "version = 4\n",
            "subsections": []
        },
        "FILE": {
            "content": "(built-in)\n\n",
            "subsections": []
        }
    },
    "summary": "marshal",
    "flags": [],
    "examples": [],
    "see_also": []
}