]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-106320: Remove _PyFunction_Vectorcall() API (#107071)
authorVictor Stinner <vstinner@python.org>
Sat, 22 Jul 2023 21:44:33 +0000 (23:44 +0200)
committerGitHub <noreply@github.com>
Sat, 22 Jul 2023 21:44:33 +0000 (21:44 +0000)
Move _PyFunction_Vectorcall() API to the internal C API.
No longer export the function.

Include/cpython/funcobject.h
Include/internal/pycore_function.h
Objects/call.c

index 6f78f5868d0166be3d475e6e78642f4025c2938b..de2013323d2c720adbba31177149d7128f90d25f 100644 (file)
@@ -79,12 +79,6 @@ PyAPI_FUNC(int) PyFunction_SetClosure(PyObject *, PyObject *);
 PyAPI_FUNC(PyObject *) PyFunction_GetAnnotations(PyObject *);
 PyAPI_FUNC(int) PyFunction_SetAnnotations(PyObject *, PyObject *);
 
-PyAPI_FUNC(PyObject *) _PyFunction_Vectorcall(
-    PyObject *func,
-    PyObject *const *stack,
-    size_t nargsf,
-    PyObject *kwnames);
-
 #define _PyFunction_CAST(func) \
     (assert(PyFunction_Check(func)), _Py_CAST(PyFunctionObject*, func))
 
index ecbb7001e7d840af5e3d1cbd31291c60b6477193..e844d323ec7927c1f18d0106d80c3fa5830770d9 100644 (file)
@@ -8,6 +8,12 @@ extern "C" {
 #  error "this header requires Py_BUILD_CORE define"
 #endif
 
+extern PyObject* _PyFunction_Vectorcall(
+    PyObject *func,
+    PyObject *const *stack,
+    size_t nargsf,
+    PyObject *kwnames);
+
 #define FUNC_MAX_WATCHERS 8
 
 struct _py_func_state {
index 396552d85cfca0f7a1b39929132bb68bf30f4d21..b1610dababd46605c3aa6ef330dbb6e4d3fed60f 100644 (file)
@@ -2,6 +2,7 @@
 #include "pycore_call.h"          // _PyObject_CallNoArgsTstate()
 #include "pycore_ceval.h"         // _Py_EnterRecursiveCallTstate()
 #include "pycore_dict.h"          // _PyDict_FromItems()
+#include "pycore_function.h"      // _PyFunction_Vectorcall() definition
 #include "pycore_modsupport.h"    // _Py_VaBuildStack()
 #include "pycore_object.h"        // _PyCFunctionWithKeywords_TrampolineCall()
 #include "pycore_pyerrors.h"      // _PyErr_Occurred()