FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

gh-104469: Convert _testcapi/vectorcall_limited.c to use AC by vstinner · Pull Request #109691 · python/cpython · GitHub

Repository navigation

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .c  (1) .h  (1) All 2 file types selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
20 changes: 20 additions & 0 deletions Modules/_testcapi/clinic/vectorcall_limited.c.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

32 changes: 27 additions & 5 deletions Modules/_testcapi/vectorcall_limited.c
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
/* Test Vectorcall in the limited API */

#define Py_LIMITED_API 0x030c0000 // 3.12
#include "parts.h"
#include "clinic/vectorcall_limited.c.h"

/* Test Vectorcall in the limited API */
/*[clinic input]
module _testcapi
[clinic start generated code]*/
/*[clinic end generated code: output=da39a3ee5e6b4b0d input=6361033e795369fc]*/

static PyObject *
LimitedVectorCallClass_tpcall(PyObject *self, PyObject *args, PyObject *kwargs) {
Expand All @@ -28,8 +34,16 @@ LimitedVectorCallClass_new(PyTypeObject *tp, PyTypeObject *a, PyTypeObject *kw)
return self;
}

/*[clinic input]
_testcapi.call_vectorcall

callable: object
/
[clinic start generated code]*/

static PyObject *
call_vectorcall(PyObject* self, PyObject *callable)
_testcapi_call_vectorcall(PyObject *module, PyObject *callable)
/*[clinic end generated code: output=bae81eec97fcaad7 input=55d88f92240957ee]*/
{
PyObject *args[3] = { NULL, NULL, NULL };
PyObject *kwname = NULL, *kwnames = NULL, *result = NULL;
Expand Down Expand Up @@ -73,8 +87,16 @@ call_vectorcall(PyObject* self, PyObject *callable)
return result;
}

/*[clinic input]
_testcapi.call_vectorcall_method

callable: object
/
[clinic start generated code]*/

static PyObject *
call_vectorcall_method(PyObject* self, PyObject *callable)
_testcapi_call_vectorcall_method(PyObject *module, PyObject *callable)
/*[clinic end generated code: output=e661f48dda08b6fb input=5ba81c27511395b6]*/
{
PyObject *args[3] = { NULL, NULL, NULL };
PyObject *name = NULL, *kwname = NULL,
Expand Down Expand Up @@ -149,8 +171,8 @@ static PyType_Spec LimitedVectorCallClass_spec = {
};

static PyMethodDef TestMethods[] = {
{"call_vectorcall", call_vectorcall, METH_O},
{"call_vectorcall_method", call_vectorcall_method, METH_O},
_TESTCAPI_CALL_VECTORCALL_METHODDEF
_TESTCAPI_CALL_VECTORCALL_METHOD_METHODDEF
{NULL},
};

Expand Down

Back | FazBrowse Home | New Git URL