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-119180: Add LOAD_COMMON_CONSTANT opcode by JelleZijlstra · Pull Request #119321 · python/cpython

Conversation

@JelleZijlstra

@JelleZijlstra JelleZijlstra commented May 21, 2024 •
edited by github-actions Bot
Loading

Uh oh!

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

Copy link
Copy Markdown
Member

The PEP 649 implementation will require a way to load NotImplementedError
from the bytecode. @markshannon suggested implementing this by converting
LOAD_ASSERTION_ERROR into a more general mechanism for loading constants.

This PR adds this new opcode. I will work on the rest of the implementation
of the PEP separately.

  • Issue: Implement PEP 649 and PEP 749 #119180

📚 Documentation preview 📚: https://cpython-previews--119321.org.readthedocs.build/

Sorry, something went wrong.

Uh oh!

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

All reactions
@JelleZijlstra
pythongh-119180: Add LOAD_COMMON_CONSTANT opcode
00d6eeb
The PEP 649 implementation will require a way to load NotImplementedError
from the bytecode. @markshannon suggested implementing this by converting
LOAD_ASSERTION_ERROR into a more general mechanism for loading constants.

This PR adds this new opcode. I will work on the rest of the implementation
of the PEP separately.
@JelleZijlstra
JelleZijlstra requested review from brettcannon, ericsnowcurrently, gvanrossum, iritkatriel, markshannon, ncoghlan and warsaw as code owners May 21, 2024 16:16
@bedevere-app bedevere-app Bot added the awaiting core review label May 21, 2024
@bedevere-app bedevere-app Bot mentioned this pull request May 21, 2024
Implement PEP 649 and PEP 749 #119180
Closed
21 of 30 tasks
JelleZijlstra
JelleZijlstra commented May 21, 2024
View reviewed changes
Comment thread Python/ceval_macros.h Resolved

Uh oh!

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

@JelleZijlstra
news
983c93c
iritkatriel
iritkatriel reviewed May 21, 2024
View reviewed changes
Comment thread Misc/NEWS.d/next/Core and Builtins/2024-05-21-12-17-02.gh-issue-119180.UNDUb9.rst Resolved

Uh oh!

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

Comment thread Python/ceval.c Resolved

Uh oh!

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

JelleZijlstra and others added 3 commits May 21, 2024 13:10
@JelleZijlstra @iritkatriel
Update Misc/NEWS.d/next/Core and Builtins/2024-05-21-12-17-02.gh-issu…
ab560cd
…e-119180.UNDUb9.rst

Co-authored-by: Irit Katriel <[email protected]>
@JelleZijlstra
Different way that should work on Windows
4d42dcc
@JelleZijlstra
Use a switch
32a2a73
@JelleZijlstra

JelleZijlstra commented May 21, 2024

Copy link
Copy Markdown
Member Author

The previous version broke the JIT. @brandtbucher helped figure out that this is because the common_constants array is empty when the JIT is being compiled. Since there didn't seem to be a simple way to make this work correctly, we decided to simply use a switch in the interpreter code instead.

All reactions

Sorry, something went wrong.

Uh oh!

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

carljm
carljm approved these changes May 21, 2024
View reviewed changes
Comment thread Misc/NEWS.d/next/Core and Builtins/2024-05-21-12-17-02.gh-issue-119180.UNDUb9.rst Resolved

Uh oh!

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

@bedevere-app bedevere-app Bot added awaiting merge and removed awaiting core review labels May 21, 2024
@JelleZijlstra
Update Misc/NEWS.d/next/Core and Builtins/2024-05-21-12-17-02.gh-issu…
6c0514d
…e-119180.UNDUb9.rst
gvanrossum
gvanrossum reviewed May 21, 2024
View reviewed changes

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

Here you go!

Sorry, something went wrong.

Uh oh!

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

All reactions
Comment thread Include/internal/pycore_opcode_metadata.h Resolved

Uh oh!

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

Comment thread Lib/importlib/_bootstrap_external.py Resolved

Uh oh!

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

Comment thread Misc/NEWS.d/next/Core and Builtins/2024-05-21-12-17-02.gh-issue-119180.UNDUb9.rst Resolved

Uh oh!

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

Comment thread Python/bytecodes.c Resolved

Uh oh!

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

Comment thread Python/ceval.c Resolved

Uh oh!

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

@JelleZijlstra
Feedback from Guido
d40a577
gvanrossum
gvanrossum approved these changes May 21, 2024
View reviewed changes

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

Yay!

Sorry, something went wrong.

Uh oh!

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

All reactions
@JelleZijlstra
JelleZijlstra enabled auto-merge (squash) May 21, 2024 20:31
@JelleZijlstra
JelleZijlstra merged commit 98e855f into python:main May 22, 2024
@bedevere-app bedevere-app Bot removed the awaiting merge label May 22, 2024
@JelleZijlstra
JelleZijlstra deleted the pep649-loadcommon branch May 22, 2024 12:26
@JelleZijlstra JelleZijlstra mentioned this pull request May 22, 2024
gh-119180: Update the magic number #119397
Merged
JelleZijlstra added a commit that referenced this pull request May 25, 2024
@JelleZijlstra
gh-119180: Update the magic number (#119397)
84be524
PR #119321 added a comment about the magic number bump
but did not actually apply the new magic number.
estyxx pushed a commit to estyxx/cpython that referenced this pull request Jul 17, 2024
@JelleZijlstra @iritkatriel @estyxx
pythongh-119180: Add LOAD_COMMON_CONSTANT opcode (python#119321)
344a053
The PEP 649 implementation will require a way to load NotImplementedError
from the bytecode. @markshannon suggested implementing this by converting
LOAD_ASSERTION_ERROR into a more general mechanism for loading constants.

This PR adds this new opcode. I will work on the rest of the implementation
of the PEP separately.

Co-authored-by: Irit Katriel <[email protected]>
estyxx pushed a commit to estyxx/cpython that referenced this pull request Jul 17, 2024
@JelleZijlstra @estyxx
pythongh-119180: Update the magic number (python#119397)
1c6cb41
PR python#119321 added a comment about the magic number bump
but did not actually apply the new magic number.
@JelleZijlstra
JelleZijlstra restored the pep649-loadcommon branch September 10, 2024 23:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@iritkatriel iritkatriel iritkatriel left review comments
@carljm carljm carljm approved these changes
@gvanrossum gvanrossum gvanrossum approved these changes
@ericsnowcurrently ericsnowcurrently Awaiting requested review from ericsnowcurrently ericsnowcurrently is a code owner
@brettcannon brettcannon Awaiting requested review from brettcannon brettcannon is a code owner
@ncoghlan ncoghlan Awaiting requested review from ncoghlan ncoghlan is a code owner
@warsaw warsaw Awaiting requested review from warsaw warsaw 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

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.

4 participants

@JelleZijlstra @carljm @iritkatriel @gvanrossum
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.