Skip to content

Commit c2fd8d5

Browse files
committed
Update documentation
1 parent cd49a51 commit c2fd8d5

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

Doc/c-api/object.rst

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -383,8 +383,10 @@ Object Protocol
383383
.. c:function:: PyObject* PyObject_Pretty(PyObject *o)
384384
385385
Return the "pretty" representation of an object *o*, which must not be
386-
``NULL``. This is used by the ``!p`` specifier for both f-strings and
387-
:func:`str.format`. This function is not directly exposed in Python.
386+
``NULL``. This is used by the ``pretty=True`` argument to built-in
387+
:func:`print`, and the ``!p`` specifier for both f-strings and
388+
:func:`str.format`. This function imports and calls :func:`pprint.pformat`
389+
with the single object argument, and is not directly exposed in Python.
388390
389391
.. versionadded:: 3.15
390392

Doc/library/functions.rst

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1612,9 +1612,8 @@ are always available. They are listed here in alphabetical order.
16121612

16131613
When *pretty* is given, it signals that the objects should be "pretty
16141614
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.
1615+
argument, the object to format.. When *pretty* is ``True``, it calls
1616+
:c:func:`PyObject_Pretty` to get the formatted representation.
16181617

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

0 commit comments

Comments
 (0)