1+ /* Test Vectorcall in the limited API */
2+
13#define Py_LIMITED_API 0x030c0000 // 3.12
24#include "parts.h"
5+ #include "clinic/vectorcall_limited.c.h"
36
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]*/
511
612static PyObject *
713LimitedVectorCallClass_tpcall (PyObject * self , PyObject * args , PyObject * kwargs ) {
@@ -28,8 +34,16 @@ LimitedVectorCallClass_new(PyTypeObject *tp, PyTypeObject *a, PyTypeObject *kw)
2834 return self ;
2935}
3036
37+ /*[clinic input]
38+ _testcapi.call_vectorcall
39+
40+ callable: object
41+ /
42+ [clinic start generated code]*/
43+
3144static 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]*/
3347{
3448 PyObject * args [3 ] = { NULL , NULL , NULL };
3549 PyObject * kwname = NULL , * kwnames = NULL , * result = NULL ;
@@ -73,8 +87,16 @@ call_vectorcall(PyObject* self, PyObject *callable)
7387 return result ;
7488}
7589
90+ /*[clinic input]
91+ _testcapi.call_vectorcall_method
92+
93+ callable: object
94+ /
95+ [clinic start generated code]*/
96+
7697static 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]*/
78100{
79101 PyObject * args [3 ] = { NULL , NULL , NULL };
80102 PyObject * name = NULL , * kwname = NULL ,
@@ -149,8 +171,8 @@ static PyType_Spec LimitedVectorCallClass_spec = {
149171};
150172
151173static 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
154176 {NULL },
155177};
156178
0 commit comments