Module pprint
[hide private]
[frames] | no frames]

Module pprint

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.

Classes [hide private]
PrettyPrinter
Functions [hide private]
string
_commajoin(S, sequence)
Return a string which is the concatenation of the strings in the sequence.
 
pprint(object, stream=None, indent=1, width=80, depth=None)
Pretty-print a Python object to a stream [default is sys.stdout].
 
pformat(object, indent=1, width=80, depth=None)
Format a Python object into a pretty-printed representation.
 
saferepr(object)
Version of repr() which can handle recursive data structures.
 
isreadable(object)
Determine if saferepr(object) is readable by eval().
 
isrecursive(object)
Determine if object requires a recursive representation.
 
_safe_repr(object, context, maxlevels, level)
 
_recursion(object)
 
_perfcheck(object=None)

Imports: _sys, _StringIO, _id, _len, _type


Function Details [hide private]

_commajoin(S, sequence)

 

Return a string which is the concatenation of the strings in the sequence. The separator between elements is S.

Returns: string