``PyThreadState.recursion_depth`` field. Remove ``_Py_CheckRecursionLimit``
from the stable ABI.
(Contributed by Victor Stinner in :issue:`38644`.)
+
* Add a new public :c:func:`PyObject_CallNoArgs` function to the C API, which
calls a callable Python object without any arguments. It is the most efficient
way to call a callable Python object without any argument.
``pyfpe.h`` from ``Py_LIMITED_API`` (stable API).
(Contributed by Victor Stinner in :issue:`38835`.)
+* Remove ``PyMethod_ClearFreeList()`` and ``PyCFunction_ClearFreeList()``
+ functions: the free lists of bound method objects have been removed.
+ (Contributed by Inada Naoki and Victor Stinner in :issue:`37340`.)
+
Deprecated
==========
#define PyMethod_GET_SELF(meth) \
(((PyMethodObject *)meth) -> im_self)
-PyAPI_FUNC(int) PyMethod_ClearFreeList(void);
-
typedef struct {
PyObject_HEAD
PyObject *func;
/* Various internal finalizers */
-extern void _PyMethod_Fini(void);
extern void _PyFrame_Fini(void);
-extern void _PyCFunction_Fini(void);
extern void _PyDict_Fini(void);
extern void _PyTuple_Fini(void);
extern void _PyList_Fini(void);
} PyCFunctionObject;
#endif
-PyAPI_FUNC(int) PyCFunction_ClearFreeList(void);
-
#ifdef __cplusplus
}
#endif
--- /dev/null
+Remove ``PyMethod_ClearFreeList()`` and ``PyCFunction_ClearFreeList()``
+functions: the free lists of bound method objects have been removed.
static void
clear_freelists(void)
{
- (void)PyMethod_ClearFreeList();
(void)PyFrame_ClearFreeList();
- (void)PyCFunction_ClearFreeList();
(void)PyTuple_ClearFreeList();
(void)PyUnicode_ClearFreeList();
(void)PyFloat_ClearFreeList();
method_new, /* tp_new */
};
-/* Clear out the free list */
-
-int
-PyMethod_ClearFreeList(void)
-{
- return 0;
-}
-
-void
-_PyMethod_Fini(void)
-{
- (void)PyMethod_ClearFreeList();
-}
-
/* ------------------------------------------------------------------------
* instance method
*/
0, /* tp_dict */
};
-/* Clear out the free list */
-
-int
-PyCFunction_ClearFreeList(void)
-{
- return 0;
-}
-
-void
-_PyCFunction_Fini(void)
-{
- (void)PyCFunction_ClearFreeList();
-}
-
-
/* Vectorcall functions for each of the PyCFunction calling conventions,
* except for METH_VARARGS (possibly combined with METH_KEYWORDS) which
* doesn't use vectorcall.
{
if (is_main_interp) {
/* Sundry finalizers */
- _PyMethod_Fini();
_PyFrame_Fini();
- _PyCFunction_Fini();
_PyTuple_Fini();
_PyList_Fini();
_PySet_Fini();