1
1
#define Py_LIMITED_API 0x030c0000 // 3.12
2
2
#include "parts.h"
3
- #include "clinic/vectorcall_limited.c.h"
4
3
5
4
#ifdef LIMITED_API_AVAILABLE
6
5
7
6
8
7
9
8
/* Test Vectorcall in the limited API */
10
9
11
- /*[clinic input]
12
- module _testcapi
13
- [clinic start generated code]*/
14
- /*[clinic end generated code: output=da39a3ee5e6b4b0d input=6361033e795369fc]*/
15
-
16
10
static PyObject *
17
11
LimitedVectorCallClass_tpcall (PyObject * self , PyObject * args , PyObject * kwargs ) {
18
12
return PyUnicode_FromString ("tp_call called" );
@@ -38,16 +32,8 @@ LimitedVectorCallClass_new(PyTypeObject *tp, PyTypeObject *a, PyTypeObject *kw)
38
32
return self ;
39
33
}
40
34
41
- /*[clinic input]
42
- _testcapi.call_vectorcall
43
-
44
- callable: object
45
- /
46
- [clinic start generated code]*/
47
-
48
35
static PyObject *
49
- _testcapi_call_vectorcall (PyObject * module , PyObject * callable )
50
- /*[clinic end generated code: output=bae81eec97fcaad7 input=55d88f92240957ee]*/
36
+ call_vectorcall (PyObject * self , PyObject * callable )
51
37
{
52
38
PyObject * args [3 ] = { NULL , NULL , NULL };
53
39
PyObject * kwname = NULL , * kwnames = NULL , * result = NULL ;
@@ -91,16 +77,8 @@ _testcapi_call_vectorcall(PyObject *module, PyObject *callable)
91
77
return result ;
92
78
}
93
79
94
- /*[clinic input]
95
- _testcapi.call_vectorcall_method
96
-
97
- callable: object
98
- /
99
- [clinic start generated code]*/
100
-
101
80
static PyObject *
102
- _testcapi_call_vectorcall_method (PyObject * module , PyObject * callable )
103
- /*[clinic end generated code: output=e661f48dda08b6fb input=5ba81c27511395b6]*/
81
+ call_vectorcall_method (PyObject * self , PyObject * callable )
104
82
{
105
83
PyObject * args [3 ] = { NULL , NULL , NULL };
106
84
PyObject * name = NULL , * kwname = NULL ,
@@ -175,8 +153,8 @@ static PyType_Spec LimitedVectorCallClass_spec = {
175
153
};
176
154
177
155
static PyMethodDef TestMethods [] = {
178
- _TESTCAPI_CALL_VECTORCALL_METHODDEF
179
- _TESTCAPI_CALL_VECTORCALL_METHOD_METHODDEF
156
+ { "call_vectorcall" , call_vectorcall , METH_O },
157
+ { "call_vectorcall_method" , call_vectorcall_method , METH_O },
180
158
{NULL },
181
159
};
182
160
0 commit comments