@@ -7,7 +7,8 @@ Type: Standards Track
77Created: 07-Nov-2025
88Python-Version: 3.16
99Post-History: `21-Feb-2026 <https://discuss.python.org/t/pep-813-the-pretty-print-protocol/106242 >`__,
10- `04-Mar-2026 <https://discuss.python.org/t/pep-813-the-pretty-print-protocol/106242/79 >`__
10+ `04-Mar-2026 <https://discuss.python.org/t/pep-813-the-pretty-print-protocol/106242/79 >`__,
11+ `24-Oct-2026 <https://discuss.python.org/t/pep-813-the-pretty-print-protocol-round-2/109651 >`__
1112
1213
1314Abstract
@@ -1217,8 +1218,9 @@ None at this time.
12171218Change History
12181219==============
12191220
1220- * `[DD-Mmm -2026] <https://discuss.python.org/t/pep-813-the-pretty-print-protocol/106242/[NNN] >`__
1221+ * `24-Oct -2026 <https://discuss.python.org/t/pep-813-the-pretty-print-protocol-round-2/109651 >`__
12211222
1223+ * Add a new default printer, ``pprint.Printer ``, and leave ``pprint.PrettyPrinter `` unchanged.
12221224 * ``__pprint__() `` describes an object's structure, and the printer makes all layout decisions.
12231225 * Section markers ``pprint.VALUES ``, ``pprint.KWARGS `` and ``pprint.ITEMS `` say how tuples are read,
12241226 replacing the reading of tuples by their shape and the "false-y" name for positional tuple values.
@@ -1228,13 +1230,12 @@ Change History
12281230 own vocabulary.
12291231 * Add ``pprint.decompose() ``, and the ``pprint.LEAF `` sentinel that it returns for a leaf.
12301232 * Defer a table of markers in the default printer, and a way to change the default printer.
1231- * Add ``pprint.DescriptionType `` for annotating ``__pprint__() `` methods.
1232- * Add a ``hints `` attribute to ``pprint.Layout ``, for particular printers.
1233+ * Add ``pprint.DescriptionType `` for type annotating ``__pprint__() `` methods.
1234+ * Add an optional ``hints `` attribute to ``pprint.Layout ``, which can be used by third-party printers.
12331235 * Add a ``hug `` attribute to ``pprint.Layout ``, so that ``defaultdict `` and similar types keep
12341236 ``PrettyPrinter ``'s layout.
1235- * Add a new default printer, ``pprint.Printer ``, and leave ``pprint.PrettyPrinter `` unchanged.
12361237 * A printer returns an iterable of lines, and ``!p `` joins them with ``'\n' ``.
1237- * Specify how the default printer lays out, sorts and limits the depth of nested objects, including keys
1238+ * Specify how the default printer lays out, sorts, and limits the depth of nested objects, including keys
12381239 that wrap.
12391240 * The default printer's ``expand `` option takes a ``pprint.Expand `` member: ``NEVER ``, ``FIT `` or
12401241 ``ALWAYS ``. Its defaults are ``width=78 ``, ``indent=4 `` and ``expand=Expand.FIT ``.
@@ -1245,7 +1246,7 @@ Change History
12451246 * The default printer's ``number_format `` option replaces ``underscore_numbers ``.
12461247 * Specify when an inherited ``__pprint__() `` is used, and explain why.
12471248 * :mod: `dataclasses ` and :func: `~collections.namedtuple ` generate ``__pprint__() `` methods.
1248- * The ``!p `` format spec is a single replacement field, ``f'{obj!p:{printer}}' ``, whose value is called
1249+ * The ``!p `` format spec can be a single replacement field, ``f'{obj!p:{printer}}' ``, whose value is called
12491250 without first being converted to a string. Any other spec is a :exc: `SyntaxError `.
12501251 * A printer of ``None `` means the default printer, in f-strings, t-strings and ``PyObject_Pretty() ``.
12511252 * In ``str.format() ``, a format spec after ``!p `` pads the pretty printed string.
0 commit comments