On this page
  1. marshal.load
  2. Import
  3. Signature & Overview
  4. Usage
  5. Gotchas
  6. REPL Inspect

marshal.load

Prev: marshal.dumps | Up: marshal | Next: marshal.loads
Rel: marshal.dump, marshal.dumps, marshal.loads
Ref: docs.python.org — marshal.load
Tags: #public #python3 #stdlib #marshal


Import

import marshal
from marshal import load

Signature & Overview

marshal.load(file, /, *, allow_code=True)

Read one value from the open file and return it.

Usage

import io
import marshal

buf = io.BytesIO(marshal.dumps((10, 20)))
assert marshal.load(buf) == (10, 20)

Gotchas

REPL Inspect

from marshal import load
help(load)

Linked from

Related notes