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: Fix frozendict.fromkeys() for subclasses by vstinner · Pull Request #144952 · python/cpython

Conversation

@vstinner

@vstinner vstinner commented Feb 18, 2026 •
edited by bedevere-app Bot
Loading

Uh oh!

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

Copy link
Copy Markdown
Member

Copy the frozendict.

  • 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
@vstinner
pythongh-141510: Fix frozendict.fromkeys() for subclasses
04e193c
Copy the frozendict.
@vstinner
vstinner requested review from markshannon and methane as code owners February 18, 2026 12:57
@bedevere-app bedevere-app Bot added the awaiting core review label Feb 18, 2026
@bedevere-app bedevere-app Bot mentioned this pull request Feb 18, 2026
PEP 814: Add built-in frozendict type #141510
Closed
corona10
corona10 reviewed Feb 18, 2026
View reviewed changes

@corona10 corona10 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.

I like this option better

Sorry, something went wrong.

Uh oh!

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

All reactions
This was referenced Feb 18, 2026
gh-141510: Fix frozendict.fromkeys() for subclasses #144947
Closed
gh-141510: Add frozendict_check_mutable() #144944
Closed
@vstinner vstinner added the skip news label Feb 18, 2026
corona10
corona10 reviewed Feb 18, 2026
View reviewed changes
Comment thread Objects/dictobject.c Resolved

Uh oh!

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

@vstinner
Use PyUnstable_Object_IsUniquelyReferenced()
3a85298
corona10
corona10 reviewed Feb 18, 2026
View reviewed changes
Comment thread Lib/test/test_dict.py Resolved

Uh oh!

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

@vstinner
Test checks that created dict is not modified
b909e49
corona10
corona10 reviewed Feb 18, 2026
View reviewed changes
Comment thread Lib/test/test_dict.py Resolved

Uh oh!

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

corona10
corona10 reviewed Feb 18, 2026
View reviewed changes
Comment thread Lib/test/test_dict.py Resolved

Uh oh!

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

corona10
corona10 reviewed Feb 18, 2026
View reviewed changes
Comment thread Lib/test/test_dict.py Resolved

Uh oh!

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

@vstinner
Simplify the test
6ecc628
@vstinner

vstinner commented Feb 18, 2026

Copy link
Copy Markdown
Member Author

@corona10: I updated the test to apply your suggestions. Please review the updated PR.

All reactions

Sorry, something went wrong.

Uh oh!

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

corona10
corona10 approved these changes Feb 18, 2026
View reviewed changes

@corona10 corona10 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.

lgtm!

Sorry, something went wrong.

Uh oh!

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

All reactions
@bedevere-app bedevere-app Bot added awaiting merge and removed awaiting core review labels Feb 18, 2026
vstinner added 2 commits February 18, 2026 16:05
@vstinner
Merge branch 'main' into frozendict_fromkeys_copy
3456cd1
@vstinner
Reuse can_modify_dict()
ee9b18a
@vstinner
vstinner enabled auto-merge (squash) February 18, 2026 15:37
@vstinner
vstinner merged commit c582ff3 into python:main Feb 18, 2026
45 checks passed

Uh oh!

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

@vstinner
vstinner deleted the frozendict_fromkeys_copy branch February 18, 2026 15:56
@bedevere-app bedevere-app Bot removed the awaiting merge label Feb 18, 2026
@vstinner

vstinner commented Feb 18, 2026

Copy link
Copy Markdown
Member Author

A case is not covered by this fix: a dict subclass which returns a frozendict! I wrote #144962 to fix this weird case.

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
@vstinner @brijkapadia
pythongh-141510: Fix frozendict.fromkeys() for subclasses (python#144952
c43117e
)

Copy the frozendict if needed.
ljfp pushed a commit to ljfp/cpython that referenced this pull request Apr 25, 2026
@vstinner @ljfp
pythongh-141510: Fix frozendict.fromkeys() for subclasses (python#144952
7166ded
)

Copy the frozendict if needed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@corona10 corona10 corona10 approved these changes
@methane methane Awaiting requested review from methane methane is a code owner
@markshannon markshannon Awaiting requested review from markshannon markshannon is a code owner

Uh oh!

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

Assignees

No one assigned

Labels

skip news

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

@vstinner @corona10
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 01402520 — 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.