On this page
  1. reprlib.Repr
  2. Import
  3. Signature & Overview
  4. Methods & Attributes
  5. Usage
  6. Gotchas
  7. REPL Inspect

reprlib.Repr

Prev: reprlib.repr | Up: reprlib
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(*, maxlevel=6, maxtuple=6, maxlist=6, maxarray=5, maxdict=4, maxset=6, maxfrozenset=6, maxdeque=6, maxstring=30, maxlong=40, maxother=30, fillvalue='...', indent=None)

reprlib.Repr class.

Methods & Attributes

Usage

import reprlib

r = reprlib.Repr(maxlist=2, maxstring=10)
assert r.repr([1, 2, 3, 4]) == '[1, 2, ...]'

Gotchas

REPL Inspect

from reprlib import Repr
help(Repr)

Linked from

Related notes