1
+ /* Test Vectorcall in the limited API */
2
+
1
3
#define Py_LIMITED_API 0x030c0000 // 3.12
2
4
#include "parts.h"
5
+ #include "clinic/vectorcall_limited.c.h"
3
6
4
- /* Test Vectorcall in the limited API */
7
+ /*[clinic input]
8
+ module _testcapi
9
+ [clinic start generated code]*/
10
+ /*[clinic end generated code: output=da39a3ee5e6b4b0d input=6361033e795369fc]*/
5
11
6
12
static PyObject *
7
13
LimitedVectorCallClass_tpcall (PyObject * self , PyObject * args , PyObject * kwargs ) {
@@ -28,8 +34,16 @@ LimitedVectorCallClass_new(PyTypeObject *tp, PyTypeObject *a, PyTypeObject *kw)
28
34
return self ;
29
35
}
30
36
37
+ /*[clinic input]
38
+ _testcapi.call_vectorcall
39
+
40
+ callable: object
41
+ /
42
+ [clinic start generated code]*/
43
+
31
44
static PyObject *
32
- call_vectorcall (PyObject * self , PyObject * callable )
45
+ _testcapi_call_vectorcall (PyObject * module , PyObject * callable )
46
+ /*[clinic end generated code: output=bae81eec97fcaad7 input=55d88f92240957ee]*/
33
47
{
34
48
PyObject * args [3 ] = { NULL , NULL , NULL };
35
49
PyObject * kwname = NULL , * kwnames = NULL , * result = NULL ;
@@ -73,8 +87,16 @@ call_vectorcall(PyObject* self, PyObject *callable)
73
87
return result ;
74
88
}
75
89
90
+ /*[clinic input]
91
+ _testcapi.call_vectorcall_method
92
+
93
+ callable: object
94
+ /
95
+ [clinic start generated code]*/
96
+
76
97
static PyObject *
77
- call_vectorcall_method (PyObject * self , PyObject * callable )
98
+ _testcapi_call_vectorcall_method (PyObject * module , PyObject * callable )
99
+ /*[clinic end generated code: output=e661f48dda08b6fb input=5ba81c27511395b6]*/
78
100
{
79
101
PyObject * args [3 ] = { NULL , NULL , NULL };
80
102
PyObject * name = NULL , * kwname = NULL ,
@@ -149,8 +171,8 @@ static PyType_Spec LimitedVectorCallClass_spec = {
149
171
};
150
172
151
173
static PyMethodDef TestMethods [] = {
152
- { "call_vectorcall" , call_vectorcall , METH_O },
153
- { "call_vectorcall_method" , call_vectorcall_method , METH_O },
174
+ _TESTCAPI_CALL_VECTORCALL_METHODDEF
175
+ _TESTCAPI_CALL_VECTORCALL_METHOD_METHODDEF
154
176
{NULL },
155
177
};
156
178
0 commit comments