Skip to content

Commit 18b54ff

Browse files
jdemeyerwebsurfer5
authored andcommitted
bpo-29548: deprecate PyEval_Call* functions (pythonGH-14804)
1 parent 93a688f commit 18b54ff

File tree

2 files changed

+13
-10
lines changed

2 files changed

+13
-10
lines changed

Include/ceval.h

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,25 +8,25 @@ extern "C" {
88
/* Interface to random parts in ceval.c */
99

1010
/* PyEval_CallObjectWithKeywords(), PyEval_CallObject(), PyEval_CallFunction
11-
* and PyEval_CallMethod are kept for backward compatibility: PyObject_Call(),
12-
* PyObject_CallFunction() and PyObject_CallMethod() are recommended to call
13-
* a callable object.
11+
* and PyEval_CallMethod are deprecated. Since they are officially part of the
12+
* stable ABI (PEP 384), they must be kept for backward compatibility.
13+
* PyObject_Call(), PyObject_CallFunction() and PyObject_CallMethod() are
14+
* recommended to call a callable object.
1415
*/
1516

16-
PyAPI_FUNC(PyObject *) PyEval_CallObjectWithKeywords(
17+
Py_DEPRECATED(3.9) PyAPI_FUNC(PyObject *) PyEval_CallObjectWithKeywords(
1718
PyObject *callable,
1819
PyObject *args,
1920
PyObject *kwargs);
2021

21-
/* Inline this */
22+
/* Deprecated since PyEval_CallObjectWithKeywords is deprecated */
2223
#define PyEval_CallObject(callable, arg) \
2324
PyEval_CallObjectWithKeywords(callable, arg, (PyObject *)NULL)
2425

25-
PyAPI_FUNC(PyObject *) PyEval_CallFunction(PyObject *callable,
26-
const char *format, ...);
27-
PyAPI_FUNC(PyObject *) PyEval_CallMethod(PyObject *obj,
28-
const char *name,
29-
const char *format, ...);
26+
Py_DEPRECATED(3.9) PyAPI_FUNC(PyObject *) PyEval_CallFunction(
27+
PyObject *callable, const char *format, ...);
28+
Py_DEPRECATED(3.9) PyAPI_FUNC(PyObject *) PyEval_CallMethod(
29+
PyObject *obj, const char *name, const char *format, ...);
3030

3131
#ifndef Py_LIMITED_API
3232
PyAPI_FUNC(void) PyEval_SetProfile(Py_tracefunc, PyObject *);
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
The functions ``PyEval_CallObject``, ``PyEval_CallFunction``,
2+
``PyEval_CallMethod`` and ``PyEval_CallObjectWithKeywords`` are deprecated.
3+
Use :c:func:`PyObject_Call` and its variants instead.

0 commit comments

Comments
 (0)