Skip to content

Comments

gh-141510: Fix copy.deepcopy() for recursive frozendict#145027

Open
vstinner wants to merge 2 commits intopython:mainfrom
vstinner:frozendict_deepcopy
Open

gh-141510: Fix copy.deepcopy() for recursive frozendict#145027
vstinner wants to merge 2 commits intopython:mainfrom
vstinner:frozendict_deepcopy

Conversation

@vstinner
Copy link
Member

@vstinner vstinner commented Feb 19, 2026

Copy link
Contributor

@eendebakpt eendebakpt left a comment

Choose a reason for hiding this comment

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

Good catch!

@serhiy-storchaka serhiy-storchaka self-requested a review February 20, 2026 09:46
@serhiy-storchaka
Copy link
Member

After adding the pickle support we may be able to remove the special deepcopy code.

@vstinner
Copy link
Member Author

I added the tests requested by @serhiy-storchaka.

@vstinner
Copy link
Member Author

After adding the pickle support we may be able to remove the special deepcopy code.

I propose merging #144967 PR first (once it will be approved), and then rework this PR. See also @serhiy-storchaka's comment on the pickle PR:

If things are pickleable, they should also be deepcopyable. It is worth to have explicit deepcopy tests, because they can preserve additional invariants. For example, it should be possible to deepcopy a frozendict containing lambdas or modules.

We can add more tests in this deepcopy PR.

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