GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — gh-141510: Support frozendict in pprint by vstinner · Pull Request #144908 · python/cpython

Conversation

@vstinner

@vstinner vstinner commented Feb 17, 2026 •
edited by bedevere-app Bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member
  • Issue: PEP 814: Add built-in frozendict type #141510

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@vstinner
pythongh-141510: Support frozendict in pprint
5d5b40d
@vstinner vstinner added the skip news label Feb 17, 2026
@bedevere-app bedevere-app Bot added the awaiting core review label Feb 17, 2026
@bedevere-app bedevere-app Bot mentioned this pull request Feb 17, 2026
PEP 814: Add built-in frozendict type #141510
Closed
@vstinner

vstinner commented Feb 18, 2026

Copy link
Copy Markdown
Member Author

cc @freddrake

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@hugovk hugovk mentioned this pull request Feb 21, 2026
Many pure python tools that have a special cases for dict should accept frozendict as well. #145056
Open
@serhiy-storchaka
serhiy-storchaka self-requested a review February 21, 2026 11:03
serhiy-storchaka
serhiy-storchaka reviewed Feb 21, 2026
View reviewed changes

@serhiy-storchaka serhiy-storchaka left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

What about frozendict views?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread Lib/pprint.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

@devdanzin

devdanzin commented Feb 21, 2026

Copy link
Copy Markdown
Member

frozendict views are standard dict views.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@devdanzin devdanzin mentioned this pull request Feb 21, 2026
Teach pprint about frozendict #145070
Closed
vstinner and others added 6 commits February 21, 2026 12:26
@vstinner @devdanzin
Move frozendict to its own function
6d36afc
Co-authored-by: devdanzin <[email protected]>
@vstinner
Add tests on keys(), values(), items()
09c2d9b
@vstinner
Merge branch 'main' into frozendict_pprint
9e2c566
@vstinner
Revert _pprint_dict() changes
fb61467
@vstinner
Add tests on empty frozendict and subclasses
3ea8049
@vstinner
Add frozendict support to _safe_repr()
9afd4bb
@vstinner

vstinner commented Feb 21, 2026

Copy link
Copy Markdown
Member Author

I completed the PR. Please review again.

What about frozendict views?

I added multiple tests on keys(), values() and items().

serhiy-storchaka reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

serhiy-storchaka
serhiy-storchaka approved these changes Feb 21, 2026
View reviewed changes

@serhiy-storchaka serhiy-storchaka left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

LGTM if all new code is covered by tests.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread Lib/pprint.py
return "{%s}" % ", ".join(components), readable, recursive
rep = "{%s}" % ", ".join(components)
if is_frozendict:
rep = f"{object.__class__.__name__}({rep})"

@serhiy-storchaka serhiy-storchaka Feb 21, 2026

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Is it covered by tests?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@vstinner vstinner Feb 21, 2026

Copy link
Copy Markdown
Member Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

This line is coverted by test_basic_line_wrap() and test_same_as_repr() tests. If I modify the code to raise an exception, both tests fail.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@bedevere-app bedevere-app Bot added awaiting merge and removed awaiting core review labels Feb 21, 2026
@vstinner
vstinner merged commit 770d354 into python:main Feb 21, 2026
49 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@vstinner
vstinner deleted the frozendict_pprint branch February 21, 2026 16:08
@bedevere-app bedevere-app Bot removed the awaiting merge label Feb 21, 2026
@vstinner

vstinner commented Feb 21, 2026

Copy link
Copy Markdown
Member Author

Merged. Thanks for reviews! Thanks for your contribution @devdanzin!

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

brijkapadia pushed a commit to brijkapadia/cpython that referenced this pull request Feb 28, 2026
@vstinner @devdanzin @brijkapadia
pythongh-141510: Support frozendict in pprint (python#144908)
bb67255
Co-authored-by: devdanzin <[email protected]>
This was referenced Mar 12, 2026
Use write instead of stream.write in PrettyPrinter._pprint_frozendict #145887
Closed
gh-145887: Use write() instead of stream.write() in PrettyPrinter._pprint_frozendict #145894
Merged
ljfp pushed a commit to ljfp/cpython that referenced this pull request Apr 25, 2026
@vstinner @devdanzin @ljfp
pythongh-141510: Support frozendict in pprint (python#144908)
21954f4
Co-authored-by: devdanzin <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@devdanzin devdanzin devdanzin left review comments
@serhiy-storchaka serhiy-storchaka serhiy-storchaka approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

skip news

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@vstinner @devdanzin @serhiy-storchaka
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.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.