@@ -48,17 +48,17 @@ Specification
4848There are two parts to this proposal.
4949
5050
51- ``__pretty__ () `` methods
51+ ``__pprint__ () `` methods
5252------------------------
5353
54- Classes can implement a new dunder method, ``__pretty__ () `` which if present, generates the pretty printed
54+ Classes can implement a new dunder method, ``__pprint__ () `` which if present, generates the pretty printed
5555representation of their instances. This augments ``__repr__() `` which, prior to this proposal, was the only
5656method used to generate a pretty representation of the object. Since object reprs provide functionality
5757distinct from pretty printing, some classes may want more control over their pretty display.
5858
59- ``__pretty__ () `` is optional; if missing, the standard pretty printers fall back to ``__repr__() ``
59+ ``__pprint__ () `` is optional; if missing, the standard pretty printers fall back to ``__repr__() ``
6060for full backward compatibility (technically speaking, :py:func: `python:pprint.saferepr ` is used).
61- However, if defined on a class, ``__pretty__ () `` has the same argument signature as
61+ However, if defined on a class, ``__pprint__ () `` has the same argument signature as
6262:py:meth: `python:pprint.PrettyPrinter.format `, taking four arguments:
6363
6464* ``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
6767* ``maxlevels `` - the requested limit to recursion
6868* ``levels `` - the current recursion level
6969
70- Similarly, ``__pretty__ () `` returns three values, the string to be used as the pretty printed representation,
70+ Similarly, ``__pprint__ () `` returns three values, the string to be used as the pretty printed representation,
7171a boolean indicating whether the returned value is "readable", and a boolean indicating whether recursion has
7272been detected. In this context, "readable" means the same as
7373:py:meth: `python:pprint.PrettyPrinter.isreadable `, i.e. that the returned value can be used to reconstruct the
0 commit comments