]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-132775: Add _PyCode_VerifyStateless() (gh-133221)
authorEric Snow <ericsnowcurrently@gmail.com>
Mon, 5 May 2025 21:48:58 +0000 (15:48 -0600)
committerGitHub <noreply@github.com>
Mon, 5 May 2025 21:48:58 +0000 (21:48 +0000)
commitd270bb57923e1e319d7d701d7bcf97a31721e2be
tree82d52ed6fae09df16465092b07804907e9d57fa7
parentf610bbdf74ea580b14353c6bfd08fd00bcbfa11e
gh-132775: Add _PyCode_VerifyStateless() (gh-133221)

"Stateless" code is a function or code object which does not rely on external state or internal state.
It may rely on arguments and builtins, but not globals or a closure. I've left a comment in
pycore_code.h that provides more detail.

We also add _PyFunction_VerifyStateless(). The new functions will be used in several later changes
that facilitate "sharing" functions and code objects between interpreters.
Include/internal/pycore_code.h
Include/internal/pycore_function.h
Include/internal/pycore_opcode_utils.h
Lib/test/_code_definitions.py
Lib/test/test_code.py
Modules/_testinternalcapi.c
Objects/codeobject.c
Objects/funcobject.c