]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
GH-145668: Add FOR_ITER specialization for virtual iterators. Specialize GET_ITER...
authorMark Shannon <Mark.Shannon@arm.com>
Thu, 16 Apr 2026 14:22:22 +0000 (15:22 +0100)
committerGitHub <noreply@github.com>
Thu, 16 Apr 2026 14:22:22 +0000 (15:22 +0100)
commit600f4dbd54bb35f56ecf1430134d2072b0520aa3
treeec3f963621dc52f879a650cc37c3aeb7c8b41ab4
parent0fcf2b72d334cfd4ecadba8d87705a9117577571
GH-145668: Add FOR_ITER specialization for virtual iterators. Specialize GET_ITER. (GH-147967)

* Add FOR_ITER_VIRTUAL to specialize FOR_ITER for virtual iterators
* Add GET_ITER_SELF to specialize GET_ITER for iterators (including generators)
* Add GET_ITER_VIRTUAL to specialize GET_ITER for iterables as virtual iterators
* Add new (internal) _tp_iteritem function slot to PyTypeObject
* Put limited RESUME at start of genexpr for free-threading. Fix up exception handling in genexpr
37 files changed:
Include/cpython/object.h
Include/internal/pycore_code.h
Include/internal/pycore_magic_number.h
Include/internal/pycore_opcode_metadata.h
Include/internal/pycore_opcode_utils.h
Include/internal/pycore_uop_ids.h
Include/internal/pycore_uop_metadata.h
Include/object.h
Include/opcode_ids.h
Lib/_opcode_metadata.py
Lib/opcode.py
Lib/test/test_capi/test_opt.py
Lib/test/test_dis.py
Lib/test/test_monitoring.py
Lib/test/test_opcache.py
Lib/test/test_sys.py
Modules/_testinternalcapi/test_cases.c.h
Modules/_testinternalcapi/test_targets.h
Objects/bytesobject.c
Objects/codeobject.c
Objects/listobject.c
Objects/tupleobject.c
Objects/unicodeobject.c
Programs/test_frozenmain.h
Python/bytecodes.c
Python/ceval.c
Python/codegen.c
Python/executor_cases.c.h
Python/flowgraph.c
Python/generated_cases.c.h
Python/opcode_targets.h
Python/optimizer.c
Python/optimizer_bytecodes.c
Python/optimizer_cases.c.h
Python/record_functions.c.h
Python/specialize.c
Tools/cases_generator/parser.py