Staging: this is not the live site, pydocs.org.
Construct a PrettyPrinter instance. Changed in 3.4, 3.8, 3.10, 3.11, 3.15 3.4: Added the compact parameter.3.8: Added the sort_dicts parameter.3.10: Added the underscore_numbers parameter.3.11: No longer attempts to write to sys.stdout if it is None.3.15: Added the expand parameter.Members of PrettyPrinter f format 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. i isreadable Determine if the formatted representation of the object is “readable,” or can be used to reconstruct the value using eval(). isrecursive Determine if the object requires a recursive representation. p pformat Return the formatted representation of object. pprint Print the formatted representation of object on the configured stream, followed by a newline.
Python docs © Python Software Foundation · Examples CC0 ·
Source on GitHub · Not affiliated with the PSF