On this page
pprint.isreadable
Up: pprint | Next: pprint.isrecursive
Rel: pprint.isrecursive, pprint.pformat, pprint.pp, pprint.pprint
Ref: docs.python.org — pprint.isreadable
Tags: #public #python3 #stdlib #pprint
Import
import pprint
from pprint import isreadable
Signature & Overview
pprint.isreadable(object)
Determine if saferepr(object) is readable by eval().
Usage
import pprint
assert pprint.isreadable({"a": [1, 2]}) is True
assert pprint.isreadable(object()) is False
Gotchas
- Checks whether
repr()looks reconstructable as a Python literal.
REPL Inspect
from pprint import isreadable
help(isreadable)
Linked from
Related notes
- tuts/python3/stdlib_module/pprint/isrecursive Linked here; links to this page; shared tags: #pprint, #stdlib
- tuts/python3/stdlib_module/pprint/pformat Linked here; links to this page; shared tags: #pprint, #stdlib
- tuts/python3/stdlib_module/pprint/pp Linked here; links to this page; shared tags: #pprint, #stdlib
- tuts/python3/stdlib_module/pprint/pprint Linked here; links to this page; shared tags: #pprint, #stdlib
- tuts/python3/stdlib_module/pprint/PrettyPrinter links to this page; shared tags: #pprint, #stdlib
- tuts/python3/stdlib_module/pprint/saferepr links to this page; shared tags: #pprint, #stdlib
- tuts/python3/stdlib_module/pprint 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