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: Use frozendict in the _opcode_metadata by vstinner · Pull Request #144910 · python/cpython

Conversation

@vstinner

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

Uh oh!

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

Copy link
Copy Markdown
Member

Enhance py_metadata_generator.py to skip duplicates.

  • 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 @corona10
pythongh-141510: Use frozendict in the _opcode_metadata
1771ae3
Enhance py_metadata_generator.py to skip duplicates.

Co-authored-by: Donghee Na <[email protected]>
@vstinner
vstinner requested a review from markshannon as a code owner February 17, 2026 12:37
@vstinner vstinner added the skip news label Feb 17, 2026
@bedevere-app bedevere-app Bot added the awaiting core review label Feb 17, 2026
@bedevere-app bedevere-app Bot mentioned this pull request Feb 17, 2026
PEP 814: Add built-in frozendict type #141510
Closed
corona10
corona10 reviewed Feb 17, 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.

We need agreement from the maintainer according to the SC recommendation.

Sorry, something went wrong.

Uh oh!

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

All reactions
@corona10 corona10 mentioned this pull request Feb 17, 2026
gh-141510: Use frozendict in the stdlib #144909
Merged
@vstinner

vstinner commented Feb 17, 2026

Copy link
Copy Markdown
Member Author

We need agreement from the maintainer according to the SC recommendation.

opcode has no maintainer according to https://devguide.python.org/core-team/experts/ and .github/CODEOWNERS.

I think that a review from 1 or 2 core devs should be enough here.

All reactions

Sorry, something went wrong.

Uh oh!

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

dolfinus
dolfinus reviewed Feb 18, 2026
View reviewed changes
Comment thread Tools/cases_generator/py_metadata_generator.py Resolved

Uh oh!

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

@vstinner
_specializations uses tuples for values
c8ef5c6
@vstinner

vstinner commented Mar 2, 2026

Copy link
Copy Markdown
Member Author

cc @Fidget-Spinner

All reactions

Sorry, something went wrong.

Uh oh!

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

@Fidget-Spinner

Fidget-Spinner commented Mar 2, 2026

Copy link
Copy Markdown
Member

cc @Fidget-Spinner

Hmm I'm not too sure. Semantically making it frozen dict is correct. However, do people use this in the wild or modify it in-place? I know it's read by PyTorch for example, but I don't know if it's modified.

All reactions

Sorry, something went wrong.

Uh oh!

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

@vstinner

vstinner commented Mar 3, 2026

Copy link
Copy Markdown
Member Author

I know it's read by PyTorch for example, but I don't know if it's modified.

PyTorch uses the C API, include <internal/pycore_opcode_metadata.h> with NEED_OPCODE_METADATA macro defined: https://github.com/search?q=repo%3Apytorch%2Fpytorch%20_opcode_metadata&type=code

This internal header file declares data as read-only. Example: const struct opcode_metadata _PyOpcode_opcode_metadata[267], notice the const in the type.

However, do people use this in the wild or modify it in-place?

It sounds weird to me to modify _opcode_metadata dictionaries. Why would someone do that? You can easily create your own copy if you really need changes.

Fidget-Spinner reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

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

@corona10

corona10 commented Mar 3, 2026 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown
Member

It sounds weird to me to modify _opcode_metadata dictionaries. Why would someone do that? You can easily create your own copy if you really need changes.

I think that we need to sync with Cinder and PyTorch people at core team Discord.

All reactions

Sorry, something went wrong.

Uh oh!

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

corona10
corona10 approved these changes Mar 3, 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 Mar 3, 2026
@vstinner
vstinner merged commit c8aa8de into python:main Mar 5, 2026
58 checks passed

Uh oh!

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

@vstinner
vstinner deleted the frozendict_opcode_metadata branch March 5, 2026 11:33
@bedevere-app bedevere-app Bot removed the awaiting merge label Mar 5, 2026
@vstinner

vstinner commented Mar 5, 2026

Copy link
Copy Markdown
Member Author

Merged, thanks for the review.

All reactions

Sorry, something went wrong.

Uh oh!

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

@vstinner vstinner mentioned this pull request Apr 7, 2026
gh-145478: Implement frozendict into functools.partial #145960
Closed
ljfp pushed a commit to ljfp/cpython that referenced this pull request Apr 25, 2026
@vstinner @corona10 @ljfp
pythongh-141510: Use frozendict in the _opcode_metadata (python#144910)
d9a2372
Enhance py_metadata_generator.py to skip duplicates.

Co-authored-by: Donghee Na <[email protected]>
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
@markshannon markshannon Awaiting requested review from markshannon markshannon is a code owner
+1 more reviewer
@dolfinus dolfinus dolfinus left review comments
Reviewers whose approvals may not affect merge requirements

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.

4 participants

@vstinner @Fidget-Spinner @corona10 @dolfinus
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.