Skip to content

Commit 556a20d

Browse files
committed
Update the print(..., pretty=callable) API
1 parent eb88192 commit 556a20d

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Doc/library/functions.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1611,10 +1611,10 @@ are always available. They are listed here in alphabetical order.
16111611
given, :func:`print` will just write *end*.
16121612

16131613
When *pretty* is given, it signals that the objects should be "pretty
1614-
printed". *pretty* can be ``True`` or an object implementing the
1615-
:meth:`pprint.PrettyPrinter.pformat` API which takes an object and returns a
1616-
formatted representation of the object. When *pretty* is ``True``, then it
1617-
calls ``PrettyPrinter.pformat()`` explicitly.
1614+
printed". *pretty* can be ``True`` or a callable object taking a single
1615+
argument, the object to pretty, and returning a formatted representation of
1616+
the object. When *pretty* is ``True``, then it calls
1617+
:meth:`pprint.PrettyPrinter.pformat` to get the formatted representation.
16181618

16191619
The *file* argument must be an object with a ``write(string)`` method; if it
16201620
is not present or ``None``, :data:`sys.stdout` will be used. Since printed

0 commit comments

Comments
 (0)