On this page
marshal.loads
Prev: marshal.load | Up: marshal
Rel: marshal.dump, marshal.dumps, marshal.load
Ref: docs.python.org — marshal.loads
Tags: #public #python3 #stdlib #marshal
Import
import marshal
from marshal import loads
Signature & Overview
marshal.loads(bytes, /, *, allow_code=True)
Convert the bytes-like object to a value.
Usage
import marshal
assert marshal.loads(marshal.dumps("ok")) == "ok"
Gotchas
- Not version-portable: Only guaranteed to match the exact
marshal.versionthat wrote it.
REPL Inspect
from marshal import loads
help(loads)
Linked from
Related notes
- tuts/python3/stdlib_module/marshal/dump Linked here; links to this page; shared tags: #marshal, #stdlib
- tuts/python3/stdlib_module/marshal/dumps Linked here; links to this page; shared tags: #marshal, #stdlib
- tuts/python3/stdlib_module/marshal/load Linked here; links to this page; shared tags: #marshal, #stdlib
- tuts/python3/stdlib_module/marshal Linked here; links to this page; shared tags: #stdlib
- tuts/c/stdlib shared tags: #stdlib
- tuts/c/stdlib/assert shared tags: #stdlib
- tuts/c/stdlib/assert/assert shared tags: #stdlib
- tuts/c/stdlib/assert/static_assert shared tags: #stdlib
- tuts/c/stdlib/ctype shared tags: #stdlib
- tuts/c/stdlib/ctype/isalpha shared tags: #stdlib