PEP 813: Address feedback so far in the DPO thread#4827
Merged
warsaw merged 16 commits intopython:mainfrom Mar 4, 2026
Merged
Conversation
* For f-strings only (not ``str.format()``) the ``!p`` conversion field takes an optional "format spec".
* The PEP no longer proposes a ``pretty`` argument to the ``print()`` built-in function. With the
addition of ``!p:callable`` syntax for f-strings, the new argument is unnecessary.
* Specify that to pretty print tuples as positional arguments, use the 2-tuple value format, passing
a "false-y" value as the argument name.
* Clarify that a truth-y ``name`` must be a ``str``.
* Specify that the ``!p`` conversion in f-strings and ``str.format()`` implicitly perform an
import of the ``pprint`` module.
* Describe the new Limited C API function ``PyObject_Pretty()``, and add the optional argument.
ericvsmith
approved these changes
Mar 4, 2026
Member
ericvsmith
left a comment
There was a problem hiding this comment.
One small nit, otherwise LGTM. Thanks!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Various language improvements, clarifying some other things explicitly, adding an open issue with a suggestion, and adding a
Deferred IdeasandChange Historysection.📚 Documentation preview 📚: https://pep-previews--4827.org.readthedocs.build/