Movatterモバイル変換


[0]ホーム

URL:


Previous PageUp One LevelNext PagePython Library ReferenceContentsModule IndexIndex
Previous:3.24 pprintUp:3.24 pprintNext:3.25 repr

 
3.24.1 PrettyPrinter Objects

PrettyPrinter instances have the following methods:

pformat(object)
Return the formatted representation ofobject. This takes intoAccount the options passed to thePrettyPrinter constructor.

pprint(object)
Print the formatted representation ofobject on the configuredstream, followed by a newline.

The following methods provide the implementations for thecorresponding functions of the same names. Using these methods on aninstance is slightly more efficient since newPrettyPrinterobjects don't need to be created.

isreadable(object)
Determine if the formatted representation of the object is``readable,'' or can be used to reconstruct the value usingeval() . Note that this returns false forrecursive objects. If thedepth parameter of thePrettyPrinter is set and the object is deeper than allowed,this returns false.

isrecursive(object)
Determine if the object requires a recursive representation.


Previous PageUp One LevelNext PagePython Library ReferenceContentsModule IndexIndex
Previous:3.24 pprintUp:3.24 pprintNext:3.25 repr
Release 2.2.3, documentation updated on 30 May 2003.
SeeAbout this document... for information on suggesting changes.
[8]ページ先頭

©2009-2026 Movatter.jp