Skip to content

gh-152600: Remove LOAD_FAST/LOAD_FAST_BORROW; POP_TOP pairs - #152643

Open
brijkapadia wants to merge 6 commits into
python:mainfrom
brijkapadia:load-fast-pop-top
Open

brijkapadia wants to merge 6 commits into
python:mainfrom
brijkapadia:load-fast-pop-top

Conversation

@brijkapadia

@brijkapadia brijkapadia commented Jun 29, 2026 •

Copy link
Copy Markdown
Contributor

Changes:

  • moved add_checks_for_loads_of_uninitialized_variables earlier so that a LOAD_FAST that should be a LOAD_FAST_CHECK is not removed.

Changes
- moved `add_checks_for_loads_of_uninitialized_variables` earlier so
  that a `LOAD_FAST` that should be a `LOAD_FAST_CHECK` are not removed.
- refactored `remove_redundant_nops_and_pairs` to be more concise. Also
  extended it so that any `COPY` gets removed. I don't think there is
  any reason to only remove `COPY` with an `oparg` of 1.

I don't think a NEWS entry is needed.
@brijkapadia
brijkapadia marked this pull request as ready for review June 30, 2026 01:10
@brijkapadia
brijkapadia requested a review from Eclips4 as a code owner October 25, 2026 00:15
@bedevere-app bedevere-app Bot added the type-feature A feature request or enhancement label Oct 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting review type-feature A feature request or enhancement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant