Skip to content

Commit 2e27da1

Browse files
authored
pythongh-104469 : Convert _testcapi/vectorcall_limited.c to use AC (pythongh-107857)
1 parent d93b4ac commit 2e27da1

File tree

2 files changed

+68
-4
lines changed

2 files changed

+68
-4
lines changed

Modules/_testcapi/clinic/vectorcall_limited.c.h

+42
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Modules/_testcapi/vectorcall_limited.c

+26-4
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,18 @@
11
#define Py_LIMITED_API 0x030c0000 // 3.12
22
#include "parts.h"
3+
#include "clinic/vectorcall_limited.c.h"
34

45
#ifdef LIMITED_API_AVAILABLE
56

67

78

89
/* Test Vectorcall in the limited API */
910

11+
/*[clinic input]
12+
module _testcapi
13+
[clinic start generated code]*/
14+
/*[clinic end generated code: output=da39a3ee5e6b4b0d input=6361033e795369fc]*/
15+
1016
static PyObject *
1117
LimitedVectorCallClass_tpcall(PyObject *self, PyObject *args, PyObject *kwargs) {
1218
return PyUnicode_FromString("tp_call called");
@@ -32,8 +38,16 @@ LimitedVectorCallClass_new(PyTypeObject *tp, PyTypeObject *a, PyTypeObject *kw)
3238
return self;
3339
}
3440

41+
/*[clinic input]
42+
_testcapi.call_vectorcall
43+
44+
callable: object
45+
/
46+
[clinic start generated code]*/
47+
3548
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]*/
3751
{
3852
PyObject *args[3] = { NULL, NULL, NULL };
3953
PyObject *kwname = NULL, *kwnames = NULL, *result = NULL;
@@ -77,8 +91,16 @@ call_vectorcall(PyObject* self, PyObject *callable)
7791
return result;
7892
}
7993

94+
/*[clinic input]
95+
_testcapi.call_vectorcall_method
96+
97+
callable: object
98+
/
99+
[clinic start generated code]*/
100+
80101
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]*/
82104
{
83105
PyObject *args[3] = { NULL, NULL, NULL };
84106
PyObject *name = NULL, *kwname = NULL,
@@ -153,8 +175,8 @@ static PyType_Spec LimitedVectorCallClass_spec = {
153175
};
154176

155177
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
158180
{NULL},
159181
};
160182

0 commit comments

Comments
 (0)