diff options
author | Mark Shannon <mark@hotpy.org> | 2022-10-27 10:55:03 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-10-27 10:55:03 (GMT) |
commit | 22863df7ca5f9cd01a40ab3dce3d067ec5666081 (patch) | |
tree | 73c460d80f41b45a331b7d886defe39127e12472 /Misc | |
parent | e60892f9db1316dbabf7a652d7648e4f968b745d (diff) | |
download | cpython-22863df7ca5f9cd01a40ab3dce3d067ec5666081.zip cpython-22863df7ca5f9cd01a40ab3dce3d067ec5666081.tar.gz cpython-22863df7ca5f9cd01a40ab3dce3d067ec5666081.tar.bz2 |
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).
Diffstat (limited to 'Misc')
-rw-r--r-- | Misc/NEWS.d/next/Core and Builtins/2022-09-13-14-07-06.gh-issue-96793.7DLRSm.rst | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/Misc/NEWS.d/next/Core and Builtins/2022-09-13-14-07-06.gh-issue-96793.7DLRSm.rst b/Misc/NEWS.d/next/Core and Builtins/2022-09-13-14-07-06.gh-issue-96793.7DLRSm.rst new file mode 100644 index 0000000..dc03fab --- /dev/null +++ b/Misc/NEWS.d/next/Core and Builtins/2022-09-13-14-07-06.gh-issue-96793.7DLRSm.rst @@ -0,0 +1,2 @@ +The :opcode:`FOR_ITER` now leaves the iterator on the stack on termination +of the loop. This is to assist specialization of loops for generators. |