[Python-checkins] cpython (2.7): #16589: fix pprint signatures in the doc (backport of 106ee4eb5970).

ezio.melotti python-checkins at python.org
Sat Dec 1 18:36:15 CET 2012


http://hg.python.org/cpython/rev/62fed5f18681
changeset:   80668:62fed5f18681
branch:      2.7
parent:      80666:1e614dae8448
user:        Ezio Melotti <ezio.melotti at gmail.com>
date:        Sat Dec 01 19:36:00 2012 +0200
summary:
  #16589: fix pprint signatures in the doc (backport of 106ee4eb5970).

files:
  Doc/library/pprint.rst |  13 ++++++-------
  1 files changed, 6 insertions(+), 7 deletions(-)


diff --git a/Doc/library/pprint.rst b/Doc/library/pprint.rst
--- a/Doc/library/pprint.rst
+++ b/Doc/library/pprint.rst
@@ -36,7 +36,7 @@
 .. First the implementation class:
 
 
-.. class:: PrettyPrinter(...)
+.. class:: PrettyPrinter(indent=1, width=80, depth=None, stream=None)
 
    Construct a :class:`PrettyPrinter` instance.  This constructor understands
    several keyword parameters.  An output stream may be set using the *stream*
@@ -73,9 +73,7 @@
 
 The :class:`PrettyPrinter` class supports several derivative functions:
 
-.. Now the derivative functions:
-
-.. function:: pformat(object[, indent[, width[, depth]]])
+.. function:: pformat(object, indent=1, width=80, depth=None)
 
    Return the formatted representation of *object* as a string.  *indent*, *width*
    and *depth* will be passed to the :class:`PrettyPrinter` constructor as
@@ -85,10 +83,10 @@
       The parameters *indent*, *width* and *depth* were added.
 
 
-.. function:: pprint(object[, stream[, indent[, width[, depth]]]])
+.. function:: pprint(object, stream=None, indent=1, width=80, depth=None)
 
    Prints the formatted representation of *object* on *stream*, followed by a
-   newline.  If *stream* is omitted, ``sys.stdout`` is used.  This may be used in
+   newline.  If *stream* is ``None``, ``sys.stdout`` is used.  This may be used in
    the interactive interpreter instead of a :keyword:`print` statement for
    inspecting values.    *indent*, *width* and *depth* will be passed to the
    :class:`PrettyPrinter` constructor as formatting parameters.
@@ -206,7 +204,8 @@
 pprint Example
 --------------
 
-This example demonstrates several uses of the :func:`pprint` function and its parameters.
+This example demonstrates several uses of the :func:`pprint` function and its
+parameters.
 
    >>> import pprint
    >>> tup = ('spam', ('eggs', ('lumberjack', ('knights', ('ni', ('dead',

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list