summaryrefslogtreecommitdiffstats
path: root/Doc/lib/libpprint.tex
diff options
context:
space:
mode:
Diffstat (limited to 'Doc/lib/libpprint.tex')
-rw-r--r--Doc/lib/libpprint.tex23
1 files changed, 23 insertions, 0 deletions
diff --git a/Doc/lib/libpprint.tex b/Doc/lib/libpprint.tex
index 3ecc7bc..22ffd7b 100644
--- a/Doc/lib/libpprint.tex
+++ b/Doc/lib/libpprint.tex
@@ -173,3 +173,26 @@ this returns false.
\begin{methoddesc}{isrecursive}{object}
Determine if the object requires a recursive representation.
\end{methoddesc}
+
+This method is provided as a hook to allow subclasses to modify the
+way objects are converted to strings. The default implementation uses
+the internals of the \function{saferepr()} implementation.
+
+\begin{methoddesc}{format}{object, context, maxlevels, level}
+Returns three values: the formatted version of \var{object} as a
+string, a flag indicating whether the result is readable, and a flag
+indicating whether recursion was detected. The first argument is the
+object to be presented. The second is a dictionary which contains the
+\function{id()} of objects that are part of the current presentation
+context (direct and indirect containers for \var{object} that are
+affecting the presentation) as the keys; if an object needs to be
+presented which is already represented in \var{context}, the third
+return value should be true. Recursive calls to the \method{format()}
+method should add additionaly entries for containers to this
+dictionary. The fourth argument, \var{maxlevels}, gives the requested
+limit to recursion; this will be \code{0} if there is no requested
+limit. This argument should be passed unmodified to recursive calls.
+The fourth argument, \var{level} gives the current level; recursive
+calls should be passed a value less than that of the current call.
+\versionadded{2.3}
+\end{methoddesc}