]> granicus.if.org Git - python/commitdiff
bpo-29548: deprecate PyEval_Call* functions (GH-14804)
authorJeroen Demeyer <J.Demeyer@UGent.be>
Wed, 24 Jul 2019 12:02:49 +0000 (14:02 +0200)
committerInada Naoki <songofacandy@gmail.com>
Wed, 24 Jul 2019 12:02:49 +0000 (21:02 +0900)
Include/ceval.h
Misc/NEWS.d/next/C API/2019-07-17-09-50-50.bpo-29548.5wIptQ.rst [new file with mode: 0644]

index e78194d512371a4fe9a159acd2d1cb34f43c34a2..61db777cc4d5bfd7b5969276d361316810657660 100644 (file)
@@ -8,25 +8,25 @@ extern "C" {
 /* Interface to random parts in ceval.c */
 
 /* PyEval_CallObjectWithKeywords(), PyEval_CallObject(), PyEval_CallFunction
- * and PyEval_CallMethod are kept for backward compatibility: PyObject_Call(),
- * PyObject_CallFunction() and PyObject_CallMethod() are recommended to call
- * a callable object.
+ * and PyEval_CallMethod are deprecated. Since they are officially part of the
+ * stable ABI (PEP 384), they must be kept for backward compatibility.
+ * PyObject_Call(), PyObject_CallFunction() and PyObject_CallMethod() are
+ * recommended to call a callable object.
  */
 
-PyAPI_FUNC(PyObject *) PyEval_CallObjectWithKeywords(
+Py_DEPRECATED(3.9) PyAPI_FUNC(PyObject *) PyEval_CallObjectWithKeywords(
     PyObject *callable,
     PyObject *args,
     PyObject *kwargs);
 
-/* Inline this */
+/* Deprecated since PyEval_CallObjectWithKeywords is deprecated */
 #define PyEval_CallObject(callable, arg) \
     PyEval_CallObjectWithKeywords(callable, arg, (PyObject *)NULL)
 
-PyAPI_FUNC(PyObject *) PyEval_CallFunction(PyObject *callable,
-                                           const char *format, ...);
-PyAPI_FUNC(PyObject *) PyEval_CallMethod(PyObject *obj,
-                                         const char *name,
-                                         const char *format, ...);
+Py_DEPRECATED(3.9) PyAPI_FUNC(PyObject *) PyEval_CallFunction(
+    PyObject *callable, const char *format, ...);
+Py_DEPRECATED(3.9) PyAPI_FUNC(PyObject *) PyEval_CallMethod(
+    PyObject *obj, const char *name, const char *format, ...);
 
 #ifndef Py_LIMITED_API
 PyAPI_FUNC(void) PyEval_SetProfile(Py_tracefunc, PyObject *);
diff --git a/Misc/NEWS.d/next/C API/2019-07-17-09-50-50.bpo-29548.5wIptQ.rst b/Misc/NEWS.d/next/C API/2019-07-17-09-50-50.bpo-29548.5wIptQ.rst
new file mode 100644 (file)
index 0000000..e740919
--- /dev/null
@@ -0,0 +1,3 @@
+The functions ``PyEval_CallObject``, ``PyEval_CallFunction``,
+``PyEval_CallMethod`` and ``PyEval_CallObjectWithKeywords`` are deprecated.
+Use :c:func:`PyObject_Call` and its variants instead.