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

gh-141510: Replace MappingProxyType with frozendict by vstinner · Pull Request #144904 · python/cpython · GitHub

/ cpython Public

gh-141510: Replace MappingProxyType with frozendict - #144904

Merged
vstinner merged 5 commits into
python:mainfrom
vstinner:frozendict_mappingproxy
Feb 18, 2026
Merged

gh-141510: Replace MappingProxyType with frozendict#144904
vstinner merged 5 commits into
python:mainfrom
vstinner:frozendict_mappingproxy

Conversation

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

Copy link
Copy Markdown
Member

Copy link
Copy Markdown
Member Author

Oh, the "Run mypy on Lib/tomllib" job fails with "Name frozendict is not defined" because it runs on an older Python version which doesn't have this new built-in type:

Run mypy --config-file Lib/tomllib/mypy.ini
Lib/tomllib/_parser.py:43: error: Name "frozendict" is not defined 
[name-defined]
    BASIC_STR_ESCAPE_REPLACEMENTS: Final = frozendict(
                                           ^~~~~~~~~~
Found 1 error in 1 file (checked 4 source files)
Error: Process completed with exit code 1.

Copy link
Copy Markdown
Member Author

I reverted the tomllib change to workaround the mypy issue.

bitdancer 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

Approving the email change only, I'm not familiar with the other code bases.

Copy link
Copy Markdown
Member Author

cc @picnixz

picnixz left a comment
edited
Loading

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

Ok for HMAC & other hashlib-related changes (they are only tests and essentially, I wanted an immutable view of a mapping so it serves us well)

Copy link
Copy Markdown
Contributor

Oh, tests are failing

0:13:17 load avg: 10.90 [1/1/1] test_dataclasses failed (1 failure)
Re-running test_dataclasses in verbose mode (matching: test_field_repr)
test_field_repr (test.test_dataclasses.TestCase.test_field_repr) ... FAIL

FAIL: test_field_repr (test.test_dataclasses.TestCase.test_field_repr)

Traceback (most recent call last):
File "/Users/runner/work/cpython/cpython/Lib/test/test_dataclasses/init.py", line 79, in test_field_repr
self.assertEqual(repr_output, expected_output)
~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: "Fiel[159 chars]dict(),kw_only=<dataclasses._MISSING_TYPE obje[50 chars]one)" != "Fiel[159 chars]dict({}),kw_only=<dataclasses._MISSING_TYPE ob[52 chars]one)"

Copy link
Copy Markdown
Contributor

I'll have a look on this as soon as I've got some time

Copy link
Copy Markdown
Member Author

I updated my branch and I updated test_dataclasses for repr(frozendict) change.

metadata=frozendict({})

I updated repr(frozendict) of empty frozendict to: frozendict() instead of frozendict({}).

Copy link
Copy Markdown
Contributor

LGTM

vstinner enabled auto-merge (squash) February 18, 2026 19:59
vstinner merged commit 0bbdb4e into python:main Feb 18, 2026
48 checks passed
vstinner deleted the frozendict_mappingproxy branch February 18, 2026 20:23

Copy link
Copy Markdown
Member Author

Merged. Thanks for reviews.

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.

5 participants


Back | FazBrowse Home | New Git URL