💾 Archived View for tris.fyi › pydoc › pprint captured on 2022-01-08 at 13:41:55. Gemini links have been rewritten to link to archived content
-=-=-=-=-=-=-
Support to pretty-print lists, tuples, & dictionaries recursively. Very simple, but useful, especially in debugging data structures. Classes ------- PrettyPrinter() Handle pretty-printing operations onto a stream using a configured set of formatting parameters. Functions --------- pformat() Format a Python object into a pretty-printed representation. pprint() Pretty-print a Python object to a stream [default is sys.stdout]. saferepr() Generate a 'standard' repr()-like value, but protect against recursive data structures.
format(self, object, context, maxlevels, level) Format object for a specific context, returning a string and flags indicating whether the representation is 'readable' and whether the object represents a recursive construct.
isreadable(self, object)
isrecursive(self, object)
pformat(self, object)
pprint(self, object)
isreadable(object) Determine if saferepr(object) is readable by eval().
isrecursive(object) Determine if object requires a recursive representation.
pformat(object, indent=1, width=80, depth=None, *, compact=False, sort_dicts=True) Format a Python object into a pretty-printed representation.
pp(object, *args, sort_dicts=False, **kwargs) Pretty-print a Python object
pprint(object, stream=None, indent=1, width=80, depth=None, *, compact=False, sort_dicts=True) Pretty-print a Python object to a stream [default is sys.stdout].
saferepr(object) Version of repr() which can handle recursive data structures.