]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
GH-143493: Conform to spec for generator expressions while supporting virtual iterato...
authorMark Shannon <Mark.Shannon@arm.com>
Fri, 16 Jan 2026 09:11:58 +0000 (09:11 +0000)
committerGitHub <noreply@github.com>
Fri, 16 Jan 2026 09:11:58 +0000 (09:11 +0000)
commitae53da57586d710504ad34c3d48d6e4303b7619a
tree660eabc2919573e827dbc79ba8e0453e54719a62
parentc461aa99e2fabbaf5859c0a8a93e08306ee8115d
GH-143493: Conform to spec for generator expressions while supporting virtual iterators (GH-143569)

* Moves the `GET_ITER` instruction into the generator function preamble.
  This means the the iterable is converted into an iterator during generator
  creation, as documented, but keeps it in the same code object allowing
  optimization.
14 files changed:
Include/internal/pycore_flowgraph.h
Include/internal/pycore_instruction_sequence.h
Include/internal/pycore_magic_number.h
Lib/test/test_compile.py
Lib/test/test_dis.py
Lib/test/test_generators.py
Misc/NEWS.d/next/Core_and_Builtins/2026-01-08-14-55-31.gh-issue-143569.-Ltu3c.rst [new file with mode: 0644]
Python/bytecodes.c
Python/codegen.c
Python/compile.c
Python/executor_cases.c.h
Python/flowgraph.c
Python/generated_cases.c.h
Python/instruction_sequence.c