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

gh-141510: Support `frozendict` in `plistlib` by hugovk · Pull Request #145590 · python/cpython · GitHub

/ cpython Public

gh-141510: Support frozendict in plistlib - #145590

Merged
hugovk merged 5 commits into
python:mainfrom
hugovk:3.15-frozendict-plistlib
Mar 31, 2026
Merged

gh-141510: Support frozendict in plistlib#145590
hugovk merged 5 commits into
python:mainfrom
hugovk:3.15-frozendict-plistlib

Conversation

hugovk commented Mar 6, 2026
edited by github-actions Bot
Loading

Copy link
Copy Markdown
Member

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

@serhiy-storchaka @ronaldoussoren: Do you want to double check this plistlib change?

Comment thread Doc/library/plistlib.rst Outdated
Comment thread Lib/plistlib.py Outdated
Comment thread Doc/library/plistlib.rst Outdated

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

Please add a NEWS entry. Note that support of frozendict is half-hearted -- only for serialization. dict_type=frozendict does not work in load(). I am not sure that it is worth to add support for deserialization.

vstinner 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

Copy link
Copy Markdown
Member

Please add a NEWS entry. Note that support of frozendict is half-hearted -- only for serialization. dict_type=frozendict does not work in load(). I am not sure that it is worth to add support for deserialization.

I saw that and hesitated to propose a follow-up change to add frozendict support for deserialization. It should be possible to create a (mutable) dict, populate the dictionary, and then convert the dict to a frozendict.

Copy link
Copy Markdown
Member

It should be possible to create a (mutable) dict, populate the dictionary, and then convert the dict to a frozendict.

This can add an overhead and this would not work in case of cyclic references in binary Plist.

Originally, dict_type was only added to support OrderedDict. Now, when dict is ordered, this parameter is mostly useless. If there was other use cases for this feature, we would need also an option to override the list type.

So, there is very little value in such feature, and it is very difficult to do without breaking corner cases. But this should be explicitly stated that frozendicts are supported only in one way (like tuple).

hugovk requested a review from AA-Turner as a code owner March 21, 2026 14:04
hugovk and others added 2 commits March 21, 2026 16:05
Co-authored-by: Victor Stinner <vstinner@python.org>

vstinner 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

hugovk merged commit 829e4d0 into python:main Mar 31, 2026
50 checks passed
hugovk deleted the 3.15-frozendict-plistlib branch March 31, 2026 12:45
clin1234 pushed a commit to clin1234/cpython that referenced this pull request Apr 16, 2026
Co-authored-by: Victor Stinner <vstinner@python.org>
ljfp pushed a commit to ljfp/cpython that referenced this pull request Apr 25, 2026
Co-authored-by: Victor Stinner <vstinner@python.org>
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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants


Back | FazBrowse Home | New Git URL