Skip to content

Commit 1d4b9d1

Browse files
committed
Exmaple fixes
1 parent cd0a257 commit 1d4b9d1

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

peps/pep-0813.rst

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ A new argument to built-in ``print``
8383
Built-in :func:`print` takes a new optional argument, appended to the end of the argument list, called
8484
``pretty``, which can take one of the following values:
8585

86-
* ``None`` - the default; fully backward compatible
86+
* ``None`` - the default. No pretty printing is invoked. Fully backward compatible
8787
* ``True`` - use a temporary instance of the :py:class:`python:pprint.PrettyPrinter` class to get a
8888
pretty representation of the object.
8989
* An instance with a ``pformat()`` method, which has the same signature as
@@ -103,7 +103,8 @@ A custom ``__pprint__()`` method can be used to customize the representation of
103103
>>> class Custom:
104104
... def __str__(self): return 'my str'
105105
... def __repr__(self): return 'my repr'
106-
... def __pprint__(self, context, maxlevels, level): return 'my pprint'
106+
... def __pprint__(self, context, maxlevels, level):
107+
... return 'my pprint', False, False
107108
108109
>>> pprint.pp(Custom())
109110
my pprint

0 commit comments

Comments
 (0)