]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-132775: Add _PyCode_GetScriptXIData() (gh-133480)
authorEric Snow <ericsnowcurrently@gmail.com>
Thu, 8 May 2025 15:07:46 +0000 (09:07 -0600)
committerGitHub <noreply@github.com>
Thu, 8 May 2025 15:07:46 +0000 (15:07 +0000)
commitc81fa2b9cd1ed4d4ff5c13984d6582c27e5f2633
treead0d56c7a551a8003c87a8b27fb2ebb4ec426470
parentf0f93ba5fa53ef5724250dd9f791d89abca04fa7
gh-132775: Add _PyCode_GetScriptXIData() (gh-133480)

This converts functions, code, str, bytes, bytearray, and memoryview objects to PyCodeObject,
and ensure that the object looks like a script.  That means no args, no return, and no closure.
_PyCode_GetPureScriptXIData() takes it a step further and ensures there are no globals.

We also add _PyObject_SupportedAsScript() to the internal C-API.
Include/internal/pycore_crossinterp.h
Include/internal/pycore_pythonrun.h
Lib/test/_code_definitions.py
Lib/test/test_code.py
Lib/test/test_crossinterp.py
Modules/_testinternalcapi.c
Python/crossinterp.c
Python/pythonrun.c