]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
GH-96793: Change `FOR_ITER` to not pop the iterator on exhaustion. (GH-96801)
authorMark Shannon <mark@hotpy.org>
Thu, 27 Oct 2022 10:55:03 +0000 (03:55 -0700)
committerGitHub <noreply@github.com>
Thu, 27 Oct 2022 10:55:03 +0000 (11:55 +0100)
commit22863df7ca5f9cd01a40ab3dce3d067ec5666081
tree73c460d80f41b45a331b7d886defe39127e12472
parente60892f9db1316dbabf7a652d7648e4f968b745d
GH-96793: Change `FOR_ITER` to not pop the iterator on exhaustion. (GH-96801)

Change FOR_ITER to have the same stack effect regardless of whether it branches or not.
Performance is unchanged as FOR_ITER (and specialized forms jump over the cleanup code).
14 files changed:
Doc/library/dis.rst
Include/internal/pycore_opcode.h
Include/opcode.h
Lib/importlib/_bootstrap_external.py
Lib/opcode.py
Lib/test/test__opcode.py
Lib/test/test_dis.py
Misc/NEWS.d/next/Core and Builtins/2022-09-13-14-07-06.gh-issue-96793.7DLRSm.rst [new file with mode: 0644]
Objects/frameobject.c
Programs/test_frozenmain.h
Python/ceval.c
Python/compile.c
Python/opcode_targets.h
Python/specialize.c