WebSafe 3.7github.com
|
|
🏠
Skip to content

gh-141510: Change repr(frozendict) for empty dict#144921

Merged
vstinner merged 2 commits intopython:mainfrom
vstinner:frozendict_repr_empty
Feb 17, 2026
Merged

gh-141510: Change repr(frozendict) for empty dict#144921
vstinner merged 2 commits intopython:mainfrom
vstinner:frozendict_repr_empty

Conversation

@vstinner
Copy link
Member

@vstinner vstinner commented Feb 17, 2026

repr(frozendict()) returns "frozendict()" instead of "frozendict({})".

repr(frozendict()) returns "frozendict()" instead of
"frozendict({})".
@vstinner
Copy link
Member Author

For example, frozenset has a similar formatting:

>>> frozenset()  # empty
frozenset()
>>> frozenset("a")
frozenset({'a'})
Copy link
Member

@corona10 corona10 left a comment

Choose a reason for hiding this comment

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

lgtm

@vstinner vstinner enabled auto-merge (squash) February 17, 2026 17:52
@vstinner vstinner merged commit d1505b5 into python:main Feb 17, 2026
45 checks passed
@vstinner vstinner deleted the frozendict_repr_empty branch February 17, 2026 18:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

2 participants

Comments