gh-106320: Move _PyMethodWrapper_Type to internal C API (#107064)

This commit is contained in:
Victor Stinner 2023-07-22 22:57:59 +02:00 committed by GitHub
parent 5e5a34ac3a
commit ee15844db8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 6 additions and 5 deletions

View File

@ -57,8 +57,6 @@ typedef struct {
void *d_wrapped; /* This can be any function pointer */ void *d_wrapped; /* This can be any function pointer */
} PyWrapperDescrObject; } PyWrapperDescrObject;
PyAPI_DATA(PyTypeObject) _PyMethodWrapper_Type;
PyAPI_FUNC(PyObject *) PyDescr_NewWrapper(PyTypeObject *, PyAPI_FUNC(PyObject *) PyDescr_NewWrapper(PyTypeObject *,
struct wrapperbase *, void *); struct wrapperbase *, void *);
PyAPI_FUNC(int) PyDescr_IsData(PyObject *); PyAPI_FUNC(int) PyDescr_IsData(PyObject *);

View File

@ -20,6 +20,8 @@ typedef struct {
typedef propertyobject _PyPropertyObject; typedef propertyobject _PyPropertyObject;
extern PyTypeObject _PyMethodWrapper_Type;
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif

View File

@ -4,11 +4,11 @@
#include "pycore_abstract.h" // _PyObject_RealIsSubclass() #include "pycore_abstract.h" // _PyObject_RealIsSubclass()
#include "pycore_call.h" // _PyStack_AsDict() #include "pycore_call.h" // _PyStack_AsDict()
#include "pycore_ceval.h" // _Py_EnterRecursiveCallTstate() #include "pycore_ceval.h" // _Py_EnterRecursiveCallTstate()
#include "pycore_descrobject.h" // _PyMethodWrapper_Type
#include "pycore_object.h" // _PyObject_GC_UNTRACK() #include "pycore_object.h" // _PyObject_GC_UNTRACK()
#include "pycore_pystate.h" // _PyThreadState_GET() #include "pycore_pystate.h" // _PyThreadState_GET()
#include "pycore_tuple.h" // _PyTuple_ITEMS() #include "pycore_tuple.h" // _PyTuple_ITEMS()
#include "structmember.h" // PyMemberDef #include "structmember.h" // PyMemberDef
#include "pycore_descrobject.h"
/*[clinic input] /*[clinic input]
class mappingproxy "mappingproxyobject *" "&PyDictProxy_Type" class mappingproxy "mappingproxyobject *" "&PyDictProxy_Type"

View File

@ -5,6 +5,7 @@
#include "pycore_call.h" // _PyObject_CallNoArgs() #include "pycore_call.h" // _PyObject_CallNoArgs()
#include "pycore_ceval.h" // _Py_EnterRecursiveCallTstate() #include "pycore_ceval.h" // _Py_EnterRecursiveCallTstate()
#include "pycore_context.h" // _PyContextTokenMissing_Type #include "pycore_context.h" // _PyContextTokenMissing_Type
#include "pycore_descrobject.h" // _PyMethodWrapper_Type
#include "pycore_dict.h" // _PyObject_MakeDictFromInstanceAttributes() #include "pycore_dict.h" // _PyObject_MakeDictFromInstanceAttributes()
#include "pycore_floatobject.h" // _PyFloat_DebugMallocStats() #include "pycore_floatobject.h" // _PyFloat_DebugMallocStats()
#include "pycore_initconfig.h" // _PyStatus_EXCEPTION() #include "pycore_initconfig.h" // _PyStatus_EXCEPTION()

View File

@ -1,5 +1,6 @@
#include "Python.h" #include "Python.h"
#include "pycore_code.h" #include "pycore_code.h"
#include "pycore_descrobject.h" // _PyMethodWrapper_Type
#include "pycore_dict.h" #include "pycore_dict.h"
#include "pycore_function.h" // _PyFunction_GetVersionForCurrentState() #include "pycore_function.h" // _PyFunction_GetVersionForCurrentState()
#include "pycore_global_strings.h" // _Py_ID() #include "pycore_global_strings.h" // _Py_ID()
@ -7,9 +8,8 @@
#include "pycore_moduleobject.h" #include "pycore_moduleobject.h"
#include "pycore_object.h" #include "pycore_object.h"
#include "pycore_opcode.h" // _PyOpcode_Caches #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 "pycore_pylifecycle.h" // _PyOS_URandomNonblock()
#include "structmember.h" // struct PyMemberDef, T_OFFSET_EX
#include <stdlib.h> // rand() #include <stdlib.h> // rand()