summaryrefslogtreecommitdiffstats
path: root/Doc/lib/libpprint.tex
diff options
context:
space:
mode:
authorWalter Dörwald <walter@livinglogic.de>2003-12-03 20:26:05 (GMT)
committerWalter Dörwald <walter@livinglogic.de>2003-12-03 20:26:05 (GMT)
commitc8de4585a6e52e1186828dd929671d3a6c36db95 (patch)
treeb3e5ad74c31c3bb634828a121f7b7d9919fabdb3 /Doc/lib/libpprint.tex
parent7a7ede54d4311d3bcb5000aeedeab8cc80391c70 (diff)
downloadcpython-c8de4585a6e52e1186828dd929671d3a6c36db95.zip
cpython-c8de4585a6e52e1186828dd929671d3a6c36db95.tar.gz
cpython-c8de4585a6e52e1186828dd929671d3a6c36db95.tar.bz2
Add parameters indent, width and depth to pprint.pprint() and pprint.pformat()
and pass them along to the PrettyPrinter constructor.
Diffstat (limited to 'Doc/lib/libpprint.tex')
-rw-r--r--Doc/lib/libpprint.tex20
1 files changed, 14 insertions, 6 deletions
diff --git a/Doc/lib/libpprint.tex b/Doc/lib/libpprint.tex
index 66f64e2..b1fd9fa 100644
--- a/Doc/lib/libpprint.tex
+++ b/Doc/lib/libpprint.tex
@@ -77,17 +77,23 @@ within the constrained width, a best effort will be made.
The \class{PrettyPrinter} class supports several derivative functions:
-\begin{funcdesc}{pformat}{object}
-Return the formatted representation of \var{object} as a string. The
-default parameters for formatting are used.
+\begin{funcdesc}{pformat}{object\optional{, indent\optional{,
+width\optional{, depth}}}}
+Return the formatted representation of \var{object} as a string. \var{indent},
+\var{width} and \var{depth} will be passed to the \class{PrettyPrinter}
+constructor as formatting parameters.
+\versionchanged[The parameters \var{indent}, \var{width} and \var{depth}
+were added]{2.4}
\end{funcdesc}
-\begin{funcdesc}{pprint}{object\optional{, stream}}
+\begin{funcdesc}{pprint}{object\optional{, stream\optional{,
+indent\optional{, width\optional{, depth}}}}}
Prints the formatted representation of \var{object} on \var{stream},
followed by a newline. If \var{stream} is omitted, \code{sys.stdout}
is used. This may be used in the interactive interpreter instead of a
-\keyword{print} statement for inspecting values. The default
-parameters for formatting are used.
+\keyword{print} statement for inspecting values. \var{indent},
+\var{width} and \var{depth} will be passed to the \class{PrettyPrinter}
+constructor as formatting parameters.
\begin{verbatim}
>>> stuff = sys.path[:]
@@ -101,6 +107,8 @@ parameters for formatting are used.
'/usr/local/lib/python1.5/sharedmodules',
'/usr/local/lib/python1.5/tkinter']
\end{verbatim}
+\versionchanged[The parameters \var{indent}, \var{width} and \var{depth}
+were added]{2.4}
\end{funcdesc}
\begin{funcdesc}{isreadable}{object}