]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-125063: Emit slices as constants in the bytecode compiler (#125064)
authorMichael Droettboom <mdboom@gmail.com>
Tue, 8 Oct 2024 17:18:39 +0000 (13:18 -0400)
committerGitHub <noreply@github.com>
Tue, 8 Oct 2024 17:18:39 +0000 (13:18 -0400)
commitc6127af8685c2a9b416207e46089cee79d028b85
treef7547bbcdcf3cf109a026410c4b81cc51b1c7316
parent7dca7322cca7ff146444e56f28f21f1090987fff
gh-125063: Emit slices as constants in the bytecode compiler (#125064)

* Make slices marshallable

* Emit slices as constants

* Update Python/marshal.c

Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
* Refactor codegen_slice into two functions so it
always has the same net effect

* Fix for free-threaded builds

* Simplify marshal loading of slices

* Only return SUCCESS/ERROR from codegen_slice

---------

Co-authored-by: Mark Shannon <mark@hotpy.org>
Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
Include/internal/pycore_magic_number.h
Lib/test/test_compile.py
Objects/codeobject.c
Objects/sliceobject.c
Python/codegen.c
Python/marshal.c