8000 gh-115999: Add free-threaded specialization for FOR_ITER by Yhg1s · Pull Request #128798 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

gh-115999: Add free-threaded specialization for FOR_ITER #128798

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 15 commits into from
Mar 12, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Merge branch 'main' into for-iter-spec
  • Loading branch information
Yhg1s authored Feb 18, 2025
commit 5c16a5ee857480d9a3ab92e617401973b407597b
15 changes: 15 additions & 0 deletions Lib/test/test_opcache.py
Original file line number Diff line number Diff line change
Expand Up @@ -1787,6 +1787,21 @@ def compare_op_str():
self.assert_specialized(compare_op_str, "COMPARE_OP_STR")
self.assert_no_opcode(compare_op_str, "COMPARE_OP")

@cpython_only
@requires_specialization_ft
def test_load_const(self):
def load_const():
def unused(): pass
# Currently, the empty tuple is immortal, and the otherwise
# unused nested function's code object is mortal. This test will
# have to use different values if either of that changes.
return ()

load_const()
self.assert_specialized(load_const, "LOAD_CONST_IMMORTAL")
self.assert_specialized(load_const, "LOAD_CONST_MORTAL")
self.assert_no_opcode(load_const, "LOAD_CONST")

@cpython_only
@requires_specialization_ft
def test_for_iter(self):
Expand Down
Loading
You are viewing a condensed version of this merge commit. You can view the full changes here.
0