GeezerVison is showing github.com — gh-141510: Use frozendict in the _opcode_metadata by vstinner · Pull Request #144910 · python/cpython
Conversation
vstinner
commented
Feb 17, 2026
•
edited by bedevere-app
Bot
Loading
Uh oh!
There was an error while loading. Please reload this page.
Enhance py_metadata_generator.py to skip duplicates.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Enhance py_metadata_generator.py to skip duplicates.
Co-authored-by: Donghee Na <[email protected]>
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.
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.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
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.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
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
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
corona10
commented
Mar 3, 2026
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
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.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
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.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
|
Merged, thanks for the review.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
ljfp
pushed a commit
to ljfp/cpython
that referenced
this pull request
Apr 25, 2026
Enhance py_metadata_generator.py to skip duplicates.
Co-authored-by: Donghee Na <[email protected]>
Reviewers
corona10
corona10 approved these changes
markshannon
Awaiting requested review from markshannon
markshannon is a code owner
+1 more reviewer
Reviewers whose approvals may not affect merge requirements
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
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.
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.
|