Skip to content

Commit 2c3d3f7

Browse files
committed
typing TypeAliasType/ParamSpecArgs/ParamSpecKwargs AC vectorcall
1 parent 0d28c47 commit 2c3d3f7

2 files changed

Lines changed: 108 additions & 14 deletions

File tree

‎Objects/clinic/typevarobject.c.h‎

Lines changed: 99 additions & 11 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎Objects/typevarobject.c‎

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1025,6 +1025,7 @@ paramspecargs_repr(PyObject *self)
10251025

10261026

10271027
/*[clinic input]
1028+
@vectorcall
10281029
@classmethod
10291030
paramspecargs.__new__ as paramspecargs_new
10301031
@@ -1035,7 +1036,7 @@ Create a ParamSpecArgs object.
10351036

10361037
static PyObject *
10371038
paramspecargs_new_impl(PyTypeObject *type, PyObject *origin)
1038-
/*[clinic end generated code: output=9a1463dc8942fe4e input=3596a0bb6183c208]*/
1039+
/*[clinic end generated code: output=9a1463dc8942fe4e input=af38ada22a6b114a]*/
10391040
{
10401041
return (PyObject *)paramspecattr_new(type, origin);
10411042
}
@@ -1072,6 +1073,7 @@ static PyType_Slot paramspecargs_slots[] = {
10721073
{Py_tp_doc, (void *)paramspecargs_doc},
10731074
{Py_tp_methods, paramspecargs_methods},
10741075
{Py_tp_new, paramspecargs_new},
1076+
{Py_tp_vectorcall, paramspecargs_vectorcall},
10751077
{Py_tp_dealloc, paramspecattr_dealloc},
10761078
{Py_tp_alloc, PyType_GenericAlloc},
10771079
{Py_tp_free, PyObject_GC_Del},
@@ -1105,6 +1107,7 @@ paramspeckwargs_repr(PyObject *self)
11051107
}
11061108

11071109
/*[clinic input]
1110+
@vectorcall
11081111
@classmethod
11091112
paramspeckwargs.__new__ as paramspeckwargs_new
11101113
@@ -1115,7 +1118,7 @@ Create a ParamSpecKwargs object.
11151118

11161119
static PyObject *
11171120
paramspeckwargs_new_impl(PyTypeObject *type, PyObject *origin)
1118-
/*[clinic end generated code: output=277b11967ebaf4ab input=981bca9b0cf9e40a]*/
1121+
/*[clinic end generated code: output=277b11967ebaf4ab input=200fd6f0d3ea40ba]*/
11191122
{
11201123
return (PyObject *)paramspecattr_new(type, origin);
11211124
}
@@ -1152,6 +1155,7 @@ static PyType_Slot paramspeckwargs_slots[] = {
11521155
{Py_tp_doc, (void *)paramspeckwargs_doc},
11531156
{Py_tp_methods, paramspeckwargs_methods},
11541157
{Py_tp_new, paramspeckwargs_new},
1158+
{Py_tp_vectorcall, paramspeckwargs_vectorcall},
11551159
{Py_tp_dealloc, paramspecattr_dealloc},
11561160
{Py_tp_alloc, PyType_GenericAlloc},
11571161
{Py_tp_free, PyObject_GC_Del},
@@ -2149,6 +2153,7 @@ static PyMethodDef typealias_methods[] = {
21492153

21502154

21512155
/*[clinic input]
2156+
@vectorcall
21522157
@classmethod
21532158
typealias.__new__ as typealias_new
21542159
@@ -2164,7 +2169,7 @@ Create a TypeAliasType.
21642169
static PyObject *
21652170
typealias_new_impl(PyTypeObject *type, PyObject *name, PyObject *value,
21662171
PyObject *type_params, PyObject *qualname)
2167-
/*[clinic end generated code: output=b7f6d9f1c577cd9c input=6516623275f87b5e]*/
2172+
/*[clinic end generated code: output=b7f6d9f1c577cd9c input=7245ee7629d55ea9]*/
21682173
{
21692174
if (type_params != NULL && !PyTuple_Check(type_params)) {
21702175
PyErr_SetString(PyExc_TypeError, "type_params must be a tuple");
@@ -2245,6 +2250,7 @@ PyTypeObject _PyTypeAlias_Type = {
22452250
.tp_alloc = PyType_GenericAlloc,
22462251
.tp_dealloc = typealias_dealloc,
22472252
.tp_new = typealias_new,
2253+
.tp_vectorcall = typealias_vectorcall,
22482254
.tp_free = PyObject_GC_Del,
22492255
.tp_iter = unpack_iter,
22502256
.tp_traverse = typealias_traverse,

0 commit comments

Comments
 (0)