Skip to content

DRAFT: Implement PEP 802 and the {/} notation #137565

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

AA-Turner
Copy link
Member

@AA-Turner AA-Turner commented Aug 8, 2025

This is a draft proof-of-concept implementation of PEP 802.

A


📚 Documentation preview 📚: https://cpython-previews--137565.org.readthedocs.build/

Copy link
Contributor

@nineteendo nineteendo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you forgot Lib/pprint.py.

@AA-Turner
Copy link
Member Author

@nineteendo can you elaborate?

Running Release|x64 interpreter...
Python 3.15.0a0 (remotes/upstream/HEAD-1-g71075ef1c9e-dirty:71075ef1c9e, Aug  8 2025, 19:28:32) [MSC v.1942 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> from pprint import pp
>>> pp({/})
{/}
>>> pp(set())
{/}
>>> pp(frozenset())
frozenset()

@nineteendo
Copy link
Contributor

nineteendo commented Aug 9, 2025

Ah, that's handled by repr(), I didn't need to change it:

cpython/Lib/pprint.py

Lines 312 to 313 in d7dbde8

if not len(object):
stream.write(repr(object))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants