Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

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

Merged
vstinner merged 2 commits into
python:mainpython/cpython:mainfrom
vstinner:frozendict_repr_emptyvstinner/cpython:frozendict_repr_emptyCopy head branch name to clipboard
Feb 17, 2026
Merged

gh-141510: Change repr(frozendict) for empty dict#144921
vstinner merged 2 commits into
python:mainpython/cpython:mainfrom
vstinner:frozendict_repr_emptyvstinner/cpython:frozendict_repr_emptyCopy head branch name to clipboard

Conversation

@vstinner

@vstinner vstinner commented Feb 17, 2026

Copy link
Copy Markdown
Member

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

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

Copy link
Copy Markdown
Member Author

For example, frozenset has a similar formatting:

>>> frozenset()  # empty
frozenset()
>>> frozenset("a")
frozenset({'a'})

@corona10 corona10 left a comment

Copy link
Copy Markdown
Member

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
brijkapadia pushed a commit to brijkapadia/cpython that referenced this pull request Feb 28, 2026
repr(frozendict()) returns "frozendict()" instead of
"frozendict({})".
ljfp pushed a commit to ljfp/cpython that referenced this pull request Apr 25, 2026
repr(frozendict()) returns "frozendict()" instead of
"frozendict({})".
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

Morty Proxy This is a proxified and sanitized view of the page, visit original site.