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