On this page
reprlib.repr
Prev: reprlib.recursive_repr | Up: reprlib | Next: reprlib.Repr
Rel: reprlib.recursive_repr, reprlib.Repr
Ref: docs.python.org — reprlib.repr
Tags: #public #python3 #stdlib #reprlib
Import
import reprlib
from reprlib import repr
Signature & Overview
reprlib.repr(x)
reprlib.repr() function.
Usage
import reprlib
assert reprlib.repr(list(range(100))) == '[0, 1, 2, 3, 4, 5, ...]'
Gotchas
- Truncated output is for logs/debugging only—never pass it to
ast.literal_eval().
REPL Inspect
from reprlib import repr
help(repr)
Linked from
Related notes
- tuts/python3/stdlib_module/reprlib/recursive_repr Linked here; links to this page; shared tags: #reprlib, #stdlib
- tuts/python3/stdlib_module/reprlib/Repr_class Linked here; links to this page; shared tags: #reprlib, #stdlib
- tuts/python3/stdlib_module/reprlib 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
- tuts/c/stdlib/ctype/isdigit shared tags: #stdlib