FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

gh-141510: Support frozendict in pprint by vstinner · Pull Request #144908 · python/cpython · GitHub

/ cpython Public

gh-141510: Support frozendict in pprint - #144908

Merged
vstinner merged 7 commits into
python:mainfrom
vstinner:frozendict_pprint
Feb 21, 2026
Merged

gh-141510: Support frozendict in pprint#144908
vstinner merged 7 commits into
python:mainfrom
vstinner:frozendict_pprint

Conversation

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

Copy link
Copy Markdown
Member

Copy link
Copy Markdown
Member Author

cc @freddrake

serhiy-storchaka 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.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

What about frozendict views?

Comment thread Lib/pprint.py Outdated

Copy link
Copy Markdown
Member

frozendict views are standard dict views.

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 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.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

LGTM if all new code is covered by tests.

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

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.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Is it covered by tests?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

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.

vstinner merged commit 770d354 into python:main Feb 21, 2026
49 checks passed
vstinner deleted the frozendict_pprint branch February 21, 2026 16:08

Copy link
Copy Markdown
Member Author

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

brijkapadia pushed a commit to brijkapadia/cpython that referenced this pull request Feb 28, 2026
Co-authored-by: devdanzin <74280297+devdanzin@users.noreply.github.com>
ljfp pushed a commit to ljfp/cpython that referenced this pull request Apr 25, 2026
Co-authored-by: devdanzin <74280297+devdanzin@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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.

3 participants


Back | FazBrowse Home | New Git URL