Uh oh!
There was an error while loading. Please reload this page.
gh-141510: Implement copy and deepcopy for frozendict - #144905
Conversation
Uh oh!
There was an error while loading. Please reload this page.
Draft because there are failing tests are due to making cpython/Lib/test/test_descr.py Line 318 in 6ef2578 I will look into this. |
Co-authored-by: Victor Stinner <vstinner@python.org>
…n into copy_module_frozendict
Sorry, my mistake. Feel free to close the PR if it is interfering. |
| return type(x)(x.__func__, deepcopy(x.__self__, memo)) | ||
| d[types.MethodType] = _deepcopy_method | ||
| _deepcopy_dispatch = frozendict(d) |
There was a problem hiding this comment.
I would prefer to not convert it to a frozendict in this PR, since it's not directly related to supporting frozendict in copy: remove this line and revert test_descr changes.
There was a problem hiding this comment.
I'll remove it here. Do you want me to open a separate PR for this part?
There was a problem hiding this comment.
I wrote #144909 to use frozendict in multiple stdlib modules. I will to see how this PR goes before proposing changing copy._deepcopy_dispatch to frozendict.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
vstinner
commented
Feb 18, 2026
Merged, thanks. |
vstinner
commented
Feb 19, 2026
Ah, the implementation doesn't work for recursive frozendict. I created #145027 to fix |
…44905) Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com> Co-authored-by: Victor Stinner <vstinner@python.org>
…44905) Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com> Co-authored-by: Victor Stinner <vstinner@python.org>
Changes cherry-picked from #141508 by @vstinner