From 398f46734c79ed409360f8a8b5c3aa4f1a4eb779 Mon Sep 17 00:00:00 2001 From: Barry Warsaw Date: Fri, 7 Nov 2025 09:19:44 -0800 Subject: [PATCH 01/12] PEP 813: The Pretty Print Protocol --- peps/pep-0813.rst | 195 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 195 insertions(+) create mode 100644 peps/pep-0813.rst diff --git a/peps/pep-0813.rst b/peps/pep-0813.rst new file mode 100644 index 00000000000..a322d7529ea --- /dev/null +++ b/peps/pep-0813.rst @@ -0,0 +1,195 @@ +PEP: 813 +Title: The Pretty Print Protocol +Author: Barry Warsaw , + Eric V. Smith +Discussions-To: Pending +Status: Draft +Type: Standards Track +Created: 07-Nov-2025 +Python-Version: 3.15 +Post-History: Pending + + +Abstract +======== + +This PEP describes the "pretty print protocol", a collection of changes proposed to make pretty printing more +customizable and convenient. + + +Motivation +========== + +"Pretty printing" is a feature which provides a capability to format object representations for better +readability. The core functionality is implemented by the standard library :mod:`pprint`. ``pprint`` +includes a class and APIs which users can invoke to format and print more readable representations of objects. +Important use cases include pretty printing large dictionaries and other complicated objects. + +The ``pprint`` module is great as far as it goes. This PEP builds on the features of this module to provide +more customization and convenience. + + +Rationale +========= + +Pretty printing is very useful for displaying complex data structures, like dictionaries read from JSON +content. By providing a way for classes to customize how their instances participate in pretty printing, +users have more options for visually improving the display and debugging of their complex data. + +By extending the built-in :py:func:`print` function to automatically pretty print its output, this feature is +made even more convenient, since no extra imports are required, and users can easily just piggyback on +well-worn "print debugging" patterns, at least for the most common use cases. + +These two extensions work independently, but hand-in-hand can provide a powerful and convenient new feature. + + +Specification +============= + +There are two parts to this proposal. + + +``__pretty__()`` methods +------------------------ + +Classes can implement a new dunder method, ``__pretty__()`` which if present, generates the pretty printed +representation of their instances. This augments ``__repr__()`` which, prior to this proposal, was the only +method used to generate a pretty representation of the object. Since object reprs provide functionality +distinct from pretty printing, some classes may want more control over their pretty display. + +``__pretty__()`` is optional; if missing, the standard pretty printers fall back to ``__repr__()`` for full +backward compatibility (technically speaking, :meth:`pprint.saferepr` is used). However, if defined on a +class, ``__pretty__()`` has the same argument signature as :py:func:`PrettyPrinter.format`, taking four +arguments: + +* ``object`` - the object to print, which is effectively always ``self`` +* ``context`` - a dictionary mapping the ``id()`` of objects which are part of the current presentation + context +* ``maxlevels`` - the requested limit to recursion +* ``levels`` - the current recursion level + +Similarly, ``__pretty__()`` returns three values, the string to be used as the pretty printed representation, +a boolean indicating whether the returned value is "readable", and a boolean indicating whether recursion has +been detected. In this context, "readable" means the same as :meth:`PrettyPrinter.isreadable`, i.e. that the +returned value can be used to reconstruct the original object using ``eval()``. + +See :py:func:`PrettyPrinter.format` for details. + + +A new argument to built-in ``print`` +------------------------------------ + +Built-in :py:func:`print` takes a new optional argument, appended to the end of the argument list, called +``pretty``, which can take one of the following values: + +* ``None`` - the default; fully backward compatible +* ``True`` - use a temporary instance of the :py:class:`PrettyPrinter` class to get a pretty representation of + the object. +* An instance with a ``pformat()`` method, which has the same signature as + :meth:`PrettyPrinter.pformat`. When given, this will usually be an instance of a subclass of + `PrettyPrinter` with its `pformat()` method overridden. Note that this form requires **an + instance** of a pretty printer, not a class, as only ``print(..., pretty=True)`` performs implicit + instantiation. + + +Examples +======== + +A custom ``__pprint__()`` method can be used to customize the representation of the object: + +.. _code-block: + + >>> class Custom: + ... def __str__(self): return 'my str' + ... def __repr__(self): return 'my repr' + ... def __pprint__(self, context, maxlevels, level): return 'my pprint' + + >>> pprint.pp(Custom()) + my pprint + +Using the ``pretty`` argument to ``print()``: + +.. _code-block: + + >>> import os + >>> print(os.pathconf_names) + {'PC_ASYNC_IO': 17, 'PC_CHOWN_RESTRICTED': 7, 'PC_FILESIZEBITS': 18, 'PC_LINK_MAX': 1, 'PC_MAX_CANON': 2, 'PC_MAX_INPUT': 3, 'PC_NAME_MAX': 4, 'PC_NO_TRUNC': 8, 'PC_PATH_MAX': 5, 'PC_PIPE_BUF': 6, 'PC_PRIO_IO': 19, 'PC_SYNC_IO': 25, 'PC_VDISABLE': 9, 'PC_MIN_HOLE_SIZE': 27, 'PC_ALLOC_SIZE_MIN': 16, 'PC_REC_INCR_XFER_SIZE': 20, 'PC_REC_MAX_XFER_SIZE': 21, 'PC_REC_MIN_XFER_SIZE': 22, 'PC_REC_XFER_ALIGN': 23, 'PC_SYMLINK_MAX': 24} + >>> print(os.pathconf_names, pretty=True) + {'PC_ALLOC_SIZE_MIN': 16, + 'PC_ASYNC_IO': 17, + 'PC_CHOWN_RESTRICTED': 7, + 'PC_FILESIZEBITS': 18, + 'PC_LINK_MAX': 1, + 'PC_MAX_CANON': 2, + 'PC_MAX_INPUT': 3, + 'PC_MIN_HOLE_SIZE': 27, + 'PC_NAME_MAX': 4, + 'PC_NO_TRUNC': 8, + 'PC_PATH_MAX': 5, + 'PC_PIPE_BUF': 6, + 'PC_PRIO_IO': 19, + 'PC_REC_INCR_XFER_SIZE': 20, + 'PC_REC_MAX_XFER_SIZE': 21, + 'PC_REC_MIN_XFER_SIZE': 22, + 'PC_REC_XFER_ALIGN': 23, + 'PC_SYMLINK_MAX': 24, + 'PC_SYNC_IO': 25, + 'PC_VDISABLE': 9} + + +Backwards Compatibility +======================= + +When none of the new features are used, this PEP is fully backward compatible, both for built-in +``print()`` and the ``pprint`` module. + + +Security Implications +===================== + +There are no known security implications for this proposal. + + +How to Teach This +================= + +Documentation and examples are added to the ``pprint`` module and the ``print()`` function. +Beginners don't need to be taught these new features until they want prettier representations of +their objects. + + +Reference Implementation +======================== + +The reference implementation is currently available as a `PEP author branch of the CPython main +branch `__. + + +Rejected Ideas +============== + +None at this time. + + +Open Issues +=========== + +TBD + +Acknowledgements +================ + +TBD + + +Footnotes +========= + +TBD + + +Copyright +========= + +This document is placed in the public domain or under the +CC0-1.0-Universal license, whichever is more permissive. From 25c70f71634415e88822f15ba4cc56df936b397a Mon Sep 17 00:00:00 2001 From: Barry Warsaw Date: Fri, 7 Nov 2025 09:22:46 -0800 Subject: [PATCH 02/12] The Elder Statesmen of Python --- .github/CODEOWNERS | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index ad28f35ce2a..23416c7b236 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -687,6 +687,7 @@ peps/pep-0807.rst @dstufft peps/pep-0809.rst @zooba peps/pep-0810.rst @pablogsal @DinoV @Yhg1s peps/pep-0811.rst @sethmlarson @gpshead +peps/pep-0813.rst @warsaw @ericvsmith # ... peps/pep-2026.rst @hugovk # ... From 55556175c45d04fc8b36784159e61278c55f6315 Mon Sep 17 00:00:00 2001 From: Barry Warsaw Date: Fri, 7 Nov 2025 09:34:48 -0800 Subject: [PATCH 03/12] Fix markup errors --- peps/pep-0813.rst | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/peps/pep-0813.rst b/peps/pep-0813.rst index a322d7529ea..a930b43d74d 100644 --- a/peps/pep-0813.rst +++ b/peps/pep-0813.rst @@ -1,7 +1,7 @@ PEP: 813 Title: The Pretty Print Protocol Author: Barry Warsaw , - Eric V. Smith + Eric V. Smith Discussions-To: Pending Status: Draft Type: Standards Track @@ -36,7 +36,7 @@ Pretty printing is very useful for displaying complex data structures, like dict content. By providing a way for classes to customize how their instances participate in pretty printing, users have more options for visually improving the display and debugging of their complex data. -By extending the built-in :py:func:`print` function to automatically pretty print its output, this feature is +By extending the built-in :func:`print` function to automatically pretty print its output, this feature is made even more convenient, since no extra imports are required, and users can easily just piggyback on well-worn "print debugging" patterns, at least for the most common use cases. @@ -57,10 +57,10 @@ representation of their instances. This augments ``__repr__()`` which, prior to method used to generate a pretty representation of the object. Since object reprs provide functionality distinct from pretty printing, some classes may want more control over their pretty display. -``__pretty__()`` is optional; if missing, the standard pretty printers fall back to ``__repr__()`` for full -backward compatibility (technically speaking, :meth:`pprint.saferepr` is used). However, if defined on a -class, ``__pretty__()`` has the same argument signature as :py:func:`PrettyPrinter.format`, taking four -arguments: +``__pretty__()`` is optional; if missing, the standard pretty printers fall back to ``__repr__()`` +for full backward compatibility (technically speaking, :py:func:`python:pprint.saferepr` is used). +However, if defined on a class, ``__pretty__()`` has the same argument signature as +:py:meth:`python:pprint.PrettyPrinter.format`, taking four arguments: * ``object`` - the object to print, which is effectively always ``self`` * ``context`` - a dictionary mapping the ``id()`` of objects which are part of the current presentation @@ -70,23 +70,24 @@ arguments: Similarly, ``__pretty__()`` returns three values, the string to be used as the pretty printed representation, a boolean indicating whether the returned value is "readable", and a boolean indicating whether recursion has -been detected. In this context, "readable" means the same as :meth:`PrettyPrinter.isreadable`, i.e. that the -returned value can be used to reconstruct the original object using ``eval()``. +been detected. In this context, "readable" means the same as +:py:meth:`python:pprint.PrettyPrinter.isreadable`, i.e. that the returned value can be used to reconstruct the +original object using ``eval()``. -See :py:func:`PrettyPrinter.format` for details. +See :py:meth:`python:pprint.PrettyPrinter.format` for details. A new argument to built-in ``print`` ------------------------------------ -Built-in :py:func:`print` takes a new optional argument, appended to the end of the argument list, called +Built-in :func:`print` takes a new optional argument, appended to the end of the argument list, called ``pretty``, which can take one of the following values: * ``None`` - the default; fully backward compatible -* ``True`` - use a temporary instance of the :py:class:`PrettyPrinter` class to get a pretty representation of - the object. +* ``True`` - use a temporary instance of the :py:class:`python:pprint.PrettyPrinter` class to get a + pretty representation of the object. * An instance with a ``pformat()`` method, which has the same signature as - :meth:`PrettyPrinter.pformat`. When given, this will usually be an instance of a subclass of + :py:meth:`python:pprint.PrettyPrinter.pformat`. When given, this will usually be an instance of a subclass of `PrettyPrinter` with its `pformat()` method overridden. Note that this form requires **an instance** of a pretty printer, not a class, as only ``print(..., pretty=True)`` performs implicit instantiation. @@ -97,7 +98,7 @@ Examples A custom ``__pprint__()`` method can be used to customize the representation of the object: -.. _code-block: +.. code-block:: >>> class Custom: ... def __str__(self): return 'my str' @@ -109,7 +110,7 @@ A custom ``__pprint__()`` method can be used to customize the representation of Using the ``pretty`` argument to ``print()``: -.. _code-block: +.. code-block:: >>> import os >>> print(os.pathconf_names) From cd0a2570081c30a103f00929ccc80cf32ea79596 Mon Sep 17 00:00:00 2001 From: Barry Warsaw Date: Fri, 7 Nov 2025 09:35:45 -0800 Subject: [PATCH 04/12] One more linting bug --- peps/pep-0813.rst | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/peps/pep-0813.rst b/peps/pep-0813.rst index a930b43d74d..e036b95409a 100644 --- a/peps/pep-0813.rst +++ b/peps/pep-0813.rst @@ -87,10 +87,10 @@ Built-in :func:`print` takes a new optional argument, appended to the end of the * ``True`` - use a temporary instance of the :py:class:`python:pprint.PrettyPrinter` class to get a pretty representation of the object. * An instance with a ``pformat()`` method, which has the same signature as - :py:meth:`python:pprint.PrettyPrinter.pformat`. When given, this will usually be an instance of a subclass of - `PrettyPrinter` with its `pformat()` method overridden. Note that this form requires **an - instance** of a pretty printer, not a class, as only ``print(..., pretty=True)`` performs implicit - instantiation. + :py:meth:`python:pprint.PrettyPrinter.pformat`. When given, this will usually be an instance of a + subclass of ``PrettyPrinter`` with its ``pformat()`` method overridden. Note that this form + requires **an instance** of a pretty printer, not a class, as only ``print(..., pretty=True)`` + performs implicit instantiation. Examples From 1d4b9d1cc8e3b84e353f8ad374ad595be085c4a8 Mon Sep 17 00:00:00 2001 From: Barry Warsaw Date: Fri, 7 Nov 2025 09:48:45 -0800 Subject: [PATCH 05/12] Exmaple fixes --- peps/pep-0813.rst | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/peps/pep-0813.rst b/peps/pep-0813.rst index e036b95409a..a4a3abb1bd9 100644 --- a/peps/pep-0813.rst +++ b/peps/pep-0813.rst @@ -83,7 +83,7 @@ A new argument to built-in ``print`` Built-in :func:`print` takes a new optional argument, appended to the end of the argument list, called ``pretty``, which can take one of the following values: -* ``None`` - the default; fully backward compatible +* ``None`` - the default. No pretty printing is invoked. Fully backward compatible * ``True`` - use a temporary instance of the :py:class:`python:pprint.PrettyPrinter` class to get a pretty representation of the object. * An instance with a ``pformat()`` method, which has the same signature as @@ -103,7 +103,8 @@ A custom ``__pprint__()`` method can be used to customize the representation of >>> class Custom: ... def __str__(self): return 'my str' ... def __repr__(self): return 'my repr' - ... def __pprint__(self, context, maxlevels, level): return 'my pprint' + ... def __pprint__(self, context, maxlevels, level): + ... return 'my pprint', False, False >>> pprint.pp(Custom()) my pprint From b8fc7e491d0864dca762b34b5054825b8e7f468d Mon Sep 17 00:00:00 2001 From: Barry Warsaw Date: Fri, 7 Nov 2025 11:20:40 -0800 Subject: [PATCH 06/12] Alone again, naturally --- .github/CODEOWNERS | 2 +- peps/pep-0813.rst | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 23416c7b236..6171f966998 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -687,7 +687,7 @@ peps/pep-0807.rst @dstufft peps/pep-0809.rst @zooba peps/pep-0810.rst @pablogsal @DinoV @Yhg1s peps/pep-0811.rst @sethmlarson @gpshead -peps/pep-0813.rst @warsaw @ericvsmith +peps/pep-0813.rst @warsaw # ... peps/pep-2026.rst @hugovk # ... diff --git a/peps/pep-0813.rst b/peps/pep-0813.rst index a4a3abb1bd9..712a535f5b0 100644 --- a/peps/pep-0813.rst +++ b/peps/pep-0813.rst @@ -1,7 +1,6 @@ PEP: 813 Title: The Pretty Print Protocol -Author: Barry Warsaw , - Eric V. Smith +Author: Barry Warsaw Discussions-To: Pending Status: Draft Type: Standards Track From 263a95b845e02dfdb925d93735c9ed642156b9e0 Mon Sep 17 00:00:00 2001 From: Barry Warsaw Date: Fri, 7 Nov 2025 12:28:13 -0800 Subject: [PATCH 07/12] Update peps/pep-0813.rst Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com> --- peps/pep-0813.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/peps/pep-0813.rst b/peps/pep-0813.rst index 712a535f5b0..83fc603c06b 100644 --- a/peps/pep-0813.rst +++ b/peps/pep-0813.rst @@ -82,7 +82,7 @@ A new argument to built-in ``print`` Built-in :func:`print` takes a new optional argument, appended to the end of the argument list, called ``pretty``, which can take one of the following values: -* ``None`` - the default. No pretty printing is invoked. Fully backward compatible +* ``None`` - the default. No pretty printing is invoked. Fully backward compatible. * ``True`` - use a temporary instance of the :py:class:`python:pprint.PrettyPrinter` class to get a pretty representation of the object. * An instance with a ``pformat()`` method, which has the same signature as From 143cb6c07c23c63cc5302f0dcd5ae7165c5d0d72 Mon Sep 17 00:00:00 2001 From: Barry Warsaw Date: Fri, 7 Nov 2025 12:34:31 -0800 Subject: [PATCH 08/12] The dunder is __pprint__(), not __pretty__() --- peps/pep-0813.rst | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/peps/pep-0813.rst b/peps/pep-0813.rst index 712a535f5b0..25e247cb74e 100644 --- a/peps/pep-0813.rst +++ b/peps/pep-0813.rst @@ -48,17 +48,17 @@ Specification There are two parts to this proposal. -``__pretty__()`` methods +``__pprint__()`` methods ------------------------ -Classes can implement a new dunder method, ``__pretty__()`` which if present, generates the pretty printed +Classes can implement a new dunder method, ``__pprint__()`` which if present, generates the pretty printed representation of their instances. This augments ``__repr__()`` which, prior to this proposal, was the only method used to generate a pretty representation of the object. Since object reprs provide functionality distinct from pretty printing, some classes may want more control over their pretty display. -``__pretty__()`` is optional; if missing, the standard pretty printers fall back to ``__repr__()`` +``__pprint__()`` is optional; if missing, the standard pretty printers fall back to ``__repr__()`` for full backward compatibility (technically speaking, :py:func:`python:pprint.saferepr` is used). -However, if defined on a class, ``__pretty__()`` has the same argument signature as +However, if defined on a class, ``__pprint__()`` has the same argument signature as :py:meth:`python:pprint.PrettyPrinter.format`, taking four arguments: * ``object`` - the object to print, which is effectively always ``self`` @@ -67,7 +67,7 @@ However, if defined on a class, ``__pretty__()`` has the same argument signature * ``maxlevels`` - the requested limit to recursion * ``levels`` - the current recursion level -Similarly, ``__pretty__()`` returns three values, the string to be used as the pretty printed representation, +Similarly, ``__pprint__()`` returns three values, the string to be used as the pretty printed representation, a boolean indicating whether the returned value is "readable", and a boolean indicating whether recursion has been detected. In this context, "readable" means the same as :py:meth:`python:pprint.PrettyPrinter.isreadable`, i.e. that the returned value can be used to reconstruct the From a8598f7674ab0bdd0a3504e459143e9ac03a217e Mon Sep 17 00:00:00 2001 From: Barry Warsaw Date: Wed, 12 Nov 2025 15:18:30 -0800 Subject: [PATCH 09/12] Update peps/pep-0813.rst Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com> --- peps/pep-0813.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/peps/pep-0813.rst b/peps/pep-0813.rst index 83fc603c06b..076310b2b9b 100644 --- a/peps/pep-0813.rst +++ b/peps/pep-0813.rst @@ -20,7 +20,7 @@ Motivation ========== "Pretty printing" is a feature which provides a capability to format object representations for better -readability. The core functionality is implemented by the standard library :mod:`pprint`. ``pprint`` +readability. The core functionality is implemented by the standard library :mod:`pprint` module. ``pprint`` includes a class and APIs which users can invoke to format and print more readable representations of objects. Important use cases include pretty printing large dictionaries and other complicated objects. From 2703f5cf10bf74c13f4d1b24d49bc02896e86af7 Mon Sep 17 00:00:00 2001 From: Barry Warsaw Date: Wed, 12 Nov 2025 15:34:04 -0800 Subject: [PATCH 10/12] Update based on @AA-Turner's feedback --- peps/pep-0813.rst | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/peps/pep-0813.rst b/peps/pep-0813.rst index aac67872db0..929d84bc0fa 100644 --- a/peps/pep-0813.rst +++ b/peps/pep-0813.rst @@ -1,6 +1,6 @@ PEP: 813 Title: The Pretty Print Protocol -Author: Barry Warsaw +Author: Barry Warsaw , Eric V. Smith Discussions-To: Pending Status: Draft Type: Standards Track @@ -21,8 +21,9 @@ Motivation "Pretty printing" is a feature which provides a capability to format object representations for better readability. The core functionality is implemented by the standard library :mod:`pprint` module. ``pprint`` -includes a class and APIs which users can invoke to format and print more readable representations of objects. -Important use cases include pretty printing large dictionaries and other complicated objects. +includes a class and APIs which users can invoke to format and print more readable representations of objects, +versus the standard ``repr()`` built-in function. Important use cases include pretty printing large +dictionaries and other complicated objects for debugging purposes. The ``pprint`` module is great as far as it goes. This PEP builds on the features of this module to provide more customization and convenience. @@ -45,7 +46,7 @@ These two extensions work independently, but hand-in-hand can provide a powerful Specification ============= -There are two parts to this proposal. +There are several parts to this proposal. ``__pprint__()`` methods @@ -54,24 +55,28 @@ There are two parts to this proposal. Classes can implement a new dunder method, ``__pprint__()`` which if present, generates the pretty printed representation of their instances. This augments ``__repr__()`` which, prior to this proposal, was the only method used to generate a pretty representation of the object. Since object reprs provide functionality -distinct from pretty printing, some classes may want more control over their pretty display. +distinct from pretty printing, some classes may want more control over their pretty display. The +:py:class:`python:pprint.PrettyPrinter` class is modified to respect an object's ``__pprint__()`` method if +present. ``__pprint__()`` is optional; if missing, the standard pretty printers fall back to ``__repr__()`` for full backward compatibility (technically speaking, :py:func:`python:pprint.saferepr` is used). However, if defined on a class, ``__pprint__()`` has the same argument signature as :py:meth:`python:pprint.PrettyPrinter.format`, taking four arguments: -* ``object`` - the object to print, which is effectively always ``self`` +* ``self`` - this object (described in ``PrettyPrinter.format()`` method as ``object``) * ``context`` - a dictionary mapping the ``id()`` of objects which are part of the current presentation context * ``maxlevels`` - the requested limit to recursion * ``levels`` - the current recursion level -Similarly, ``__pprint__()`` returns three values, the string to be used as the pretty printed representation, -a boolean indicating whether the returned value is "readable", and a boolean indicating whether recursion has -been detected. In this context, "readable" means the same as -:py:meth:`python:pprint.PrettyPrinter.isreadable`, i.e. that the returned value can be used to reconstruct the -original object using ``eval()``. +Similarly, ``__pprint__()`` returns three values: + +* the string to be used as the pretty printed representation +* a boolean indicating whether the returned value is "readable" (defined by + :py:meth:`python:pprint.PrettyPrinter.isreadable`, i.e. that the returned value can be used to reconstruct the + original object using ``eval()``). +* boolean indicating whether recursion has been detected. See :py:meth:`python:pprint.PrettyPrinter.format` for details. From 686fc4dae50ea23ce7fe37320af5267f640ef713 Mon Sep 17 00:00:00 2001 From: Barry Warsaw Date: Wed, 12 Nov 2025 15:37:45 -0800 Subject: [PATCH 11/12] Update peps/pep-0813.rst Co-authored-by: Carol Willing --- peps/pep-0813.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/peps/pep-0813.rst b/peps/pep-0813.rst index 929d84bc0fa..5da5a6e8bd3 100644 --- a/peps/pep-0813.rst +++ b/peps/pep-0813.rst @@ -54,7 +54,7 @@ There are several parts to this proposal. Classes can implement a new dunder method, ``__pprint__()`` which if present, generates the pretty printed representation of their instances. This augments ``__repr__()`` which, prior to this proposal, was the only -method used to generate a pretty representation of the object. Since object reprs provide functionality +method used to generate a custom representation of the object. Since object reprs provide functionality distinct from pretty printing, some classes may want more control over their pretty display. The :py:class:`python:pprint.PrettyPrinter` class is modified to respect an object's ``__pprint__()`` method if present. From 062eef6fb26c197c00aea217499c38674e149451 Mon Sep 17 00:00:00 2001 From: Barry Warsaw Date: Sun, 16 Nov 2025 19:55:10 -0800 Subject: [PATCH 12/12] Update CODEOWNERS --- .github/CODEOWNERS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index a6b047aa666..f99fc66b933 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -687,7 +687,7 @@ peps/pep-0808.rst @FFY00 peps/pep-0809.rst @zooba peps/pep-0810.rst @pablogsal @DinoV @Yhg1s peps/pep-0811.rst @sethmlarson @gpshead -peps/pep-0813.rst @warsaw +peps/pep-0813.rst @warsaw @ericvsmith peps/pep-0814.rst @vstinner @corona10 # ... peps/pep-2026.rst @hugovk