bpo-46850: Move private _PyEval functions to internal C API#31532
bpo-46850: Move private _PyEval functions to internal C API#31532vstinner wants to merge 1 commit intopython:mainfrom vstinner:pycore_ceval
Conversation
|
Code search on top 5000 PyPI projects (2022-01-26). This PR seems to impact a bunch of projects. numpy-1.22.1.zip: Cython-0.29.26.tar.gz: ok, copy of CPython gdb libpython.py debugpy-1.5.1.zip: uvloop-0.16.0.tar.gz: ok, just a comment py_spy-0.3.11.tar.gz: ok, just a comment pydevd-2.7.0.tar.gz: ptvsd-4.3.2.zip: pickle5-0.0.12.tar.gz: use _PyEval_GetBuiltinId() pydevd-pycharm-213.6777.8.tar.gz: osmium-3.2.0.tar.gz: ok, Valgrind suppression file tweedledum-1.1.1.tar.gz: ok, Valgrind suppression file |
|
I modified the PR to keep _PyEval_GetBuiltinId(): it's used by the pickle5 project. It's a backport for Python 3.7 and older: https://pypi.org/project/pickle5/ But it should not harm to keep this function for now. |
|
@brandtbucher @markshannon: Do you think that it would be a good idea to move functions like _PyEval_EvalFrameDefault(), _PyEval_SetProfile() and _PyEval_SetSwitchInterval() to the internal C API? First, I created this PR just for _PyEval_EvalFrameDefault() :-) |
Remove the following _PyEval private functions (move them to the internal C API pycore_ceval.h header): * _PyEval_CallTracing() * _PyEval_EvalFrameDefault() * _PyEval_GetAsyncGenFinalizer() * _PyEval_GetAsyncGenFirstiter() * _PyEval_GetCoroutineOriginTrackingDepth() * _PyEval_GetSwitchInterval() * _PyEval_RequestCodeExtraIndex() * _PyEval_SetAsyncGenFinalizer() * _PyEval_SetAsyncGenFirstiter() * _PyEval_SetProfile() * _PyEval_SetSwitchInterval() * _PyEval_SetTrace() _PyEval_EvalFrameDefault() uses the InterpreterFrame type which is only part of the internal C API. Keep the following functions in Include/cpython/ceval.h: * _PyEval_GetBuiltin() * _PyEval_GetBuiltinId() * _PyEval_SliceIndex() * _PyEval_SliceIndexNotNone()
|
I splitted the PR into smaller PRs: see https://bugs.python.org/issue46850 |
Move the following private functions to the internal C API:
_PyEval_EvalFrameDefault() uses "struct _interpreter_frame" which is
part of the internal C API.
Keep the following functions in Include/cpython/ceval.h:
https://bugs.python.org/issue46850