]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
GH-132554: "Virtual" iterators (GH-132555)
authorMark Shannon <mark@hotpy.org>
Tue, 27 May 2025 14:59:45 +0000 (15:59 +0100)
committerGitHub <noreply@github.com>
Tue, 27 May 2025 14:59:45 +0000 (15:59 +0100)
commitf6f4e8a6622d556641799b02aed7ac018d878cdc
treee154eb35d37f836733601bee16a970a3b24c0b76
parent9300a596d37d058e6e58d00a2ad70617c863a3de
GH-132554: "Virtual" iterators (GH-132555)

* FOR_ITER now pushes either the iterator and NULL or leaves the iterable and pushes tagged zero

* NEXT_ITER uses the tagged int as the index into the sequence or, if TOS is NULL, iterates as before.
25 files changed:
Include/internal/pycore_ceval.h
Include/internal/pycore_code.h
Include/internal/pycore_compile.h
Include/internal/pycore_magic_number.h
Include/internal/pycore_opcode_metadata.h
Include/internal/pycore_stackref.h
Include/internal/pycore_uop_ids.h
Include/internal/pycore_uop_metadata.h
Lib/test/test_dis.py
Lib/test/test_list.py
Misc/NEWS.d/next/Core_and_Builtins/2025-04-30-14-13-01.gh-issue-132554.GqQaUp.rst [new file with mode: 0644]
Objects/frameobject.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/optimizer_bytecodes.c
Python/optimizer_cases.c.h
Python/specialize.c
Python/stackrefs.c
Tools/cases_generator/analyzer.py
Tools/cases_generator/generators_common.py