GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — gh-141510: Implement copy and deepcopy for frozendict by eendebakpt · Pull Request #144905 · python/cpython

Conversation

@eendebakpt

@eendebakpt eendebakpt commented Feb 17, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Changes cherry-picked from #141508 by @vstinner

  • Issue: PEP 814: Add built-in frozendict type #141510

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@eendebakpt
Implement copy and deepcopy for frozendict
d2fbcd8
@bedevere-app bedevere-app Bot added the awaiting review label Feb 17, 2026
@bedevere-app bedevere-app Bot mentioned this pull request Feb 17, 2026
New tutorial tests in test_generators.py #41510
Closed
@eendebakpt eendebakpt changed the title gh-41510: Implement copy and deepcopy for frozendict gh-141510: Implement copy and deepcopy for frozendict Feb 17, 2026
@bedevere-app bedevere-app Bot mentioned this pull request Feb 17, 2026
PEP 814: Add built-in frozendict type #141510
Closed
@blurb-it
📜🤖 Added by blurb_it.
8399c49
@eendebakpt
eendebakpt marked this pull request as draft February 17, 2026 11:37
@bedevere-app bedevere-app Bot removed the awaiting review label Feb 17, 2026
vstinner
vstinner reviewed Feb 17, 2026
View reviewed changes

@vstinner vstinner left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Why is it a draft PR?

Changes cherry-picked from #141508 by @vstinner

I'm surprised that you created a PR from my WIP work. I'm currently splitting this big PR into smaller pieces, as I wrote in the PR.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread Lib/test/test_copy.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

@eendebakpt

eendebakpt commented Feb 17, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor Author

Draft because there are failing tests are due to making _deepcopy_dispatch immutable. The failing test is a bit strange, see

cpython/Lib/test/test_descr.py

Line 318 in 6ef2578

# This is an ugly hack:

I will look into this.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

eendebakpt and others added 4 commits February 17, 2026 21:28
@eendebakpt
adjust tests
d3ee7d1
@eendebakpt @vstinner
Update Lib/test/test_copy.py
b0729ae
Co-authored-by: Victor Stinner <[email protected]>
@eendebakpt
Merge branch 'copy_module_frozendict' of github.com:eendebakpt/cpytho…
bca564d
…n into copy_module_frozendict
@eendebakpt
whitespace
4efeee3
@eendebakpt

eendebakpt commented Feb 17, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor Author

I'm surprised that you created a PR from my WIP work. I'm currently splitting this big PR into smaller pieces, as I wrote in the PR.

Sorry, my mistake. Feel free to close the PR if it is interfering.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

vstinner
vstinner reviewed Feb 17, 2026
View reviewed changes
Comment thread Lib/copy.py Outdated
return type(x)(x.__func__, deepcopy(x.__self__, memo))
d[types.MethodType] = _deepcopy_method

_deepcopy_dispatch = frozendict(d)

@vstinner vstinner Feb 17, 2026

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

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.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@eendebakpt eendebakpt Feb 17, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

I'll remove it here. Do you want me to open a separate PR for this part?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@vstinner vstinner Feb 17, 2026

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

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.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
eendebakpt
eendebakpt commented Feb 17, 2026
View reviewed changes
Comment thread Lib/test/test_descr.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

eendebakpt added 3 commits February 17, 2026 22:03
@eendebakpt
review comments
2dfc60a
@eendebakpt
Merge branch 'main' into copy_module_frozendict
8b877ac
@eendebakpt
Merge branch 'main' into copy_module_frozendict
7d2d3b2
@eendebakpt
eendebakpt marked this pull request as ready for review February 17, 2026 22:55
@bedevere-app bedevere-app Bot added the awaiting review label Feb 17, 2026
@vstinner
vstinner merged commit dd64e42 into python:main Feb 18, 2026
49 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-app bedevere-app Bot removed the awaiting review label Feb 18, 2026
@vstinner

vstinner commented Feb 18, 2026

Copy link
Copy Markdown
Member

Merged, thanks.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@vstinner

vstinner commented Feb 19, 2026

Copy link
Copy Markdown
Member

Ah, the implementation doesn't work for recursive frozendict. I created #145027 to fix copy.deepcopy() for recursive frozendict.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

brijkapadia pushed a commit to brijkapadia/cpython that referenced this pull request Feb 28, 2026
@eendebakpt @blurb-it
@vstinner @brijkapadia
pythongh-141510: Implement copy and deepcopy for frozendict (python#1…
583b9d7
…44905)

Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Victor Stinner <[email protected]>
ljfp pushed a commit to ljfp/cpython that referenced this pull request Apr 25, 2026
@eendebakpt @blurb-it
@vstinner @ljfp
pythongh-141510: Implement copy and deepcopy for frozendict (python#1…
b47f161
…44905)

Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Victor Stinner <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@vstinner vstinner vstinner left review comments

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@eendebakpt @vstinner
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.