]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-106320: Move _PyMethodWrapper_Type to internal C API (#107064)
authorVictor Stinner <vstinner@python.org>
Sat, 22 Jul 2023 20:57:59 +0000 (22:57 +0200)
committerGitHub <noreply@github.com>
Sat, 22 Jul 2023 20:57:59 +0000 (20:57 +0000)
Include/cpython/descrobject.h
Include/internal/pycore_descrobject.h
Objects/descrobject.c
Objects/object.c
Python/specialize.c

index e2ea1b9a2d305803e11f6fab6ceb06d607fc089c..bbad8b59c225ab5a8e52493dcebd08ab7499e67e 100644 (file)
@@ -57,8 +57,6 @@ typedef struct {
     void *d_wrapped; /* This can be any function pointer */
 } PyWrapperDescrObject;
 
-PyAPI_DATA(PyTypeObject) _PyMethodWrapper_Type;
-
 PyAPI_FUNC(PyObject *) PyDescr_NewWrapper(PyTypeObject *,
                                                 struct wrapperbase *, void *);
 PyAPI_FUNC(int) PyDescr_IsData(PyObject *);
index 76378569df90e3e9857162443f010a4db1e5dc8c..3cec59a68a3d2b2af5320fe1435c13a4aa66886c 100644 (file)
@@ -20,6 +20,8 @@ typedef struct {
 
 typedef propertyobject _PyPropertyObject;
 
+extern PyTypeObject _PyMethodWrapper_Type;
+
 #ifdef __cplusplus
 }
 #endif
index 810bd196e8f7e747897c59bc19fd6f454c618f77..74aa70bed7de98f0fe6fb36d1fb084f46ef72bcc 100644 (file)
@@ -4,11 +4,11 @@
 #include "pycore_abstract.h"      // _PyObject_RealIsSubclass()
 #include "pycore_call.h"          // _PyStack_AsDict()
 #include "pycore_ceval.h"         // _Py_EnterRecursiveCallTstate()
+#include "pycore_descrobject.h"   // _PyMethodWrapper_Type
 #include "pycore_object.h"        // _PyObject_GC_UNTRACK()
 #include "pycore_pystate.h"       // _PyThreadState_GET()
 #include "pycore_tuple.h"         // _PyTuple_ITEMS()
 #include "structmember.h"         // PyMemberDef
-#include "pycore_descrobject.h"
 
 /*[clinic input]
 class mappingproxy "mappingproxyobject *" "&PyDictProxy_Type"
index 93396bf5491d351310b83cc68e98531b9d5223cf..740d4a22c103b2360419ff347440a2984e670406 100644 (file)
@@ -5,6 +5,7 @@
 #include "pycore_call.h"          // _PyObject_CallNoArgs()
 #include "pycore_ceval.h"         // _Py_EnterRecursiveCallTstate()
 #include "pycore_context.h"       // _PyContextTokenMissing_Type
+#include "pycore_descrobject.h"   // _PyMethodWrapper_Type
 #include "pycore_dict.h"          // _PyObject_MakeDictFromInstanceAttributes()
 #include "pycore_floatobject.h"   // _PyFloat_DebugMallocStats()
 #include "pycore_initconfig.h"    // _PyStatus_EXCEPTION()
index dcf4be712db20d028fb561d433975c041ed4134c..5892f5441c98e2356a6613dca0bc962a73676dda 100644 (file)
@@ -1,5 +1,6 @@
 #include "Python.h"
 #include "pycore_code.h"
+#include "pycore_descrobject.h"   // _PyMethodWrapper_Type
 #include "pycore_dict.h"
 #include "pycore_function.h"      // _PyFunction_GetVersionForCurrentState()
 #include "pycore_global_strings.h"  // _Py_ID()
@@ -7,9 +8,8 @@
 #include "pycore_moduleobject.h"
 #include "pycore_object.h"
 #include "pycore_opcode.h"        // _PyOpcode_Caches
-#include "structmember.h"         // struct PyMemberDef, T_OFFSET_EX
-#include "pycore_descrobject.h"
 #include "pycore_pylifecycle.h"   // _PyOS_URandomNonblock()
+#include "structmember.h"         // struct PyMemberDef, T_OFFSET_EX
 
 #include <stdlib.h> // rand()