Skip to content

Comments

gh-145153: The PEP 813 (pretty print protocol) reference implementation#144931

Draft
warsaw wants to merge 51 commits intopython:mainfrom
warsaw:pprint
Draft

gh-145153: The PEP 813 (pretty print protocol) reference implementation#144931
warsaw wants to merge 51 commits intopython:mainfrom
warsaw:pprint

Conversation

@warsaw
Copy link
Member

@warsaw warsaw commented Feb 17, 2026

warsaw added 30 commits October 25, 2025 13:47
* Update the docs on the `print()` function to describe the new `pretty` keyword
* Document the `__pprint__()` protocol.
* Add a test for the `__pprint__()` protocol method.
* Update the docs on the `print()` function to describe the new `pretty` keyword
* Document the `__pprint__()` protocol.
* Add a test for the `__pprint__()` protocol method.
@warsaw warsaw changed the title The PEP 813 (pretty print protocol) reference implementation gh-#145153: The PEP 813 (pretty print protocol) reference implementation Feb 24, 2026
@warsaw warsaw changed the title gh-#145153: The PEP 813 (pretty print protocol) reference implementation gh-145153: The PEP 813 (pretty print protocol) reference implementation Feb 24, 2026
For `print(..., pretty=object)` simplify so that it's not an object that has a .pformat() method, but it just
needs to be a callable taking a single arg, returning the pretty formatted string.
* Document it in the C-API docs.
* Express the refcounting semantics in refcounts.dat.
* Describe PyObject_Pretty in the stable_abi.dat and stable_abi.toml files.
* Add tests to test_capi/test_abstract.py
@warsaw warsaw self-assigned this Feb 24, 2026
@warsaw warsaw requested a review from ericvsmith February 24, 2026 18:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants