pprint - pydoc - phpman

Look up a command

 

Markdown Format | JSON API | MCP Server Tool


pprint
NAME MODULE REFERENCE DESCRIPTION CLASSES FUNCTIONS DATA FILE
Help on module pprint:

NAME
    pprint - Support to pretty-print lists, tuples, & dictionaries recursively.

MODULE REFERENCE
    https://docs.python.org/3.10/library/pprint.html

    The following documentation is automatically generated from the Python
    source files.  It may be incomplete, incorrect or include features that
    are considered implementation detail and may vary between Python
    implementations.  When in doubt, consult the module reference at the
    location listed above.

DESCRIPTION
    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
    builtins.object
        PrettyPrinter

    class PrettyPrinter(builtins.object)
     |  PrettyPrinter(indent=1, width=80, depth=None, stream=None, *, compact=False, sort_dicts=True, underscore_numbers=False)
     |
     |  Methods defined here:
     |
     |  __init__(self, indent=1, width=80, depth=None, stream=None, *, compact=False, sort_dicts=True, underscore_numbers=False)
     |      Handle pretty printing operations onto a stream using a set of
     |      configured parameters.
     |
     |      indent
     |          Number of spaces to indent for each level of nesting.
     |
     |      width
     |          Attempted maximum number of columns in the output.
     |
     |      depth
     |          The maximum depth to print out nested structures.
     |
     |      stream
     |          The desired output stream.  If omitted (or false), the standard
     |          output stream available at construction will be used.
     |
     |      compact
     |          If true, several items will be combined in one line.
     |
     |      sort_dicts
     |          If true, dict keys are sorted.
     |
     |  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)
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors defined here:
     |
     |  __dict__
     |      dictionary for instance variables (if defined)
     |
     |  __weakref__
     |      list of weak references to the object (if defined)

FUNCTIONS
    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, underscore_numbers=False)
        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, underscore_numbers=False)
        Pretty-print a Python object to a stream [default is sys.stdout].

    saferepr(object)
        Version of repr() which can handle recursive data structures.

DATA
    __all__ = ['pprint', 'pformat', 'isreadable', 'isrecursive', 'saferepr...

FILE
    /usr/lib/python3.10/pprint.py



Generated by phpMan Author: Che Dong Under GNU General Public License
2026-06-02 05:13 @216.73.216.198 CrawledBy Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)
Valid XHTML 1.0 TransitionalValid CSS!

^_back to top