@@ -1587,17 +1587,23 @@ are always available. They are listed here in alphabetical order.
15871587 supported.
15881588
15891589
1590- .. function :: print(*objects, sep=' ', end='\n', file=None, flush=False)
1590+ .. function :: print(*objects, sep=' ', end='\n', file=None, flush=False, pretty=None )
15911591
1592- Print *objects * to the text stream *file *, separated by *sep * and followed
1593- by *end *. *sep *, *end *, *file *, and *flush *, if present, must be given as keyword
1594- arguments.
1592+ Print *objects * to the text stream *file *, separated by *sep * and followed by
1593+ *end *. *sep *, *end *, *file *, *flush *, and *pretty *, if present, must be
1594+ given as keyword arguments.
1595+
1596+ When *pretty * is ``None ``, all non-keyword arguments are converted to
1597+ strings like :func: `str ` does and written to the stream, separated by *sep *
1598+ and followed by *end *. Both *sep * and *end * must be strings; they can also
1599+ be ``None ``, which means to use the default values. If no *objects * are
1600+ given, :func: `print ` will just write *end *.
15951601
1596- All non-keyword arguments are converted to strings like :func: ` str ` does and
1597- written to the stream, separated by * sep * and followed by * end *. Both * sep *
1598- and * end * must be strings; they can also be `` None ``, which means to use the
1599- default values. If no * objects * are given, :func: ` print ` will just write
1600- * end * .
1602+ When * pretty * is given, it signals that the objects should be "pretty
1603+ printed". * pretty * can be `` True `` or an object implementing the
1604+ :method: ` PrettyPrinter.pprint() ` API which takes an object and returns a
1605+ formatted representation of the object. When * pretty * is `` True ``, then it
1606+ actually does call `` PrettyPrinter.pformat() `` explicitly .
16011607
16021608 The *file * argument must be an object with a ``write(string) `` method; if it
16031609 is not present or ``None ``, :data: `sys.stdout ` will be used. Since printed
@@ -1611,6 +1617,9 @@ are always available. They are listed here in alphabetical order.
16111617 .. versionchanged :: 3.3
16121618 Added the *flush * keyword argument.
16131619
1620+ .. versionchanged :: 3.15
1621+ Added the *pretty * keyword argument.
1622+
16141623
16151624.. class :: property(fget=None, fset=None, fdel=None, doc=None)
16161625
0 commit comments