From 24cbdcfdc29c125ebf1b0319b455da8cd71b1bd1 Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Wed, 8 Oct 2025 01:08:20 +0200 Subject: [PATCH] gh-112075: Remove _PyObject_SetManagedDict() function Move it to the internal C API and no longer export it. --- Include/cpython/object.h | 1 - Include/internal/pycore_object.h | 3 ++- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Include/cpython/object.h b/Include/cpython/object.h index 4e6f86f29d8473..36ddc046d28880 100644 --- a/Include/cpython/object.h +++ b/Include/cpython/object.h @@ -442,7 +442,6 @@ PyAPI_FUNC(int) _Py_ReachedRecursionLimitWithMargin(PyThreadState *tstate, int m PyAPI_FUNC(void *) PyObject_GetItemData(PyObject *obj); PyAPI_FUNC(int) PyObject_VisitManagedDict(PyObject *obj, visitproc visit, void *arg); -PyAPI_FUNC(int) _PyObject_SetManagedDict(PyObject *obj, PyObject *new_dict); PyAPI_FUNC(void) PyObject_ClearManagedDict(PyObject *obj); diff --git a/Include/internal/pycore_object.h b/Include/internal/pycore_object.h index 40f8ca68c00b72..5a76011072a7e9 100644 --- a/Include/internal/pycore_object.h +++ b/Include/internal/pycore_object.h @@ -1031,7 +1031,8 @@ enum _PyAnnotateFormat { _Py_ANNOTATE_FORMAT_STRING = 4, }; -int _PyObject_SetDict(PyObject *obj, PyObject *value); +extern int _PyObject_SetDict(PyObject *obj, PyObject *value); +extern int _PyObject_SetManagedDict(PyObject *obj, PyObject *new_dict); #ifndef Py_GIL_DISABLED static inline Py_ALWAYS_INLINE void _Py_INCREF_MORTAL(PyObject *op)