diff options
Diffstat (limited to 'Doc/library/reprlib.rst')
-rw-r--r-- | Doc/library/reprlib.rst | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/Doc/library/reprlib.rst b/Doc/library/reprlib.rst index 4b37c5b..bb94b60 100644 --- a/Doc/library/reprlib.rst +++ b/Doc/library/reprlib.rst @@ -17,12 +17,31 @@ debugger and may be useful in other contexts as well. This module provides a class, an instance, and a function: -.. class:: Repr() +.. class:: Repr(*, maxlevel=6, maxtuple=6, maxlist=6, maxarray=5, maxdict=4, \ + maxset=6, maxfrozenset=6, maxdeque=6, maxstring=30, maxlong=40, \ + maxother=30, fillvalue="...") Class which provides formatting services useful in implementing functions similar to the built-in :func:`repr`; size limits for different object types are added to avoid the generation of representations which are excessively long. + The keyword arguments of the constructor can be used as a shortcut to set the + attributes of the :class:`Repr` instance. Which means that the following + initialization:: + + aRepr = reprlib.Repr(maxlevel=3) + + Is equivalent to:: + + aRepr = reprlib.Repr() + aRepr.maxlevel = 3 + + See section `Repr Objects`_ for more information about :class:`Repr` + attributes. + + .. versionchanged:: 3.12 + Allow attributes to be set via keyword arguments. + .. data:: aRepr |