8000 GH-115986 Fix `pprint` documentation by Privat33r-dev · Pull Request #116019 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

GH-115986 Fix pprint documentation #116019

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
Feb 28, 2024
Prev Previous commit
Next Next commit
Add prefix to 'pprint.pprint' references
  • Loading branch information
Privat33r-dev committed Feb 28, 2024
commit a9298cd0fabf0e041bc3ca9f4e027ac6aec78ae4
6 changes: 3 additions & 3 deletions Doc/library/pprint.rst
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ Functions
Prints the formatted representation of *object* followed by a newline.
If *sort_dicts* is false (the default), dictionaries will be displayed with
their keys in insertion order, otherwise the dict keys will be sorted.
*args* and *kwargs* will be passed to :func:`pprint.pprint` as formatting
*args* and *kwargs* will be passed to :func:`~pprint.pprint` as formatting
parameters.

.. versionadded:: 3.8
Expand Down Expand Up @@ -267,7 +267,7 @@ are converted to strings. The default implementation uses the internals of the
Example
-------

To demonstrate several uses of the :func:`pprint.pprint` function and its parameters,
To demonstrate several uses of the :func:`~pprint.pprint` function and its parameters,
let's fetch information about a project from `PyPI <https://pypi.org>`_::

>>> import json
Expand All @@ -276,7 +276,7 @@ let's fetch information about a project from `PyPI <https://pypi.org>`_::
>>> with urlopen('https://pypi.org/pypi/sampleproject/json') as resp:
... project_info = json.load(resp)['info']

In its basic form, :func:`pprint.pprint` shows the whole object::
In its basic form, :func:`~pprint.pprint` shows the whole object::

>>> pprint.pprint(project_info)
{'author': 'The Python Packaging Authority',
Expand Down
0