@@ -4148,36 +4148,32 @@ PyDoc_STRVAR(test_vararg_and_posonly__doc__,
4148
4148
{"test_vararg_and_posonly", _PyCFunction_CAST(test_vararg_and_posonly), METH_FASTCALL, test_vararg_and_posonly__doc__},
4149
4149
4150
4150
static PyObject *
4151
- test_vararg_and_posonly_impl (PyObject * module , PyObject * a , PyObject * args );
4151
+ test_vararg_and_posonly_impl (PyObject * module , PyObject * a , Py_ssize_t nargs ,
4152
+ PyObject * const * args );
4152
4153
4153
4154
static PyObject *
4154
4155
test_vararg_and_posonly (PyObject * module , PyObject * const * args , Py_ssize_t nargs )
4155
4156
{
4156
4157
PyObject * return_value = NULL ;
4158
+ Py_ssize_t nvararg = nargs - 1 ;
4157
4159
PyObject * a ;
4158
- PyObject * __clinic_args = NULL ;
4160
+ PyObject * const * __clinic_args = NULL ;
4159
4161
4160
4162
if (!_PyArg_CheckPositional ("test_vararg_and_posonly" , nargs , 1 , PY_SSIZE_T_MAX )) {
4161
4163
goto exit ;
4162
4164
}
4163
4165
a = args [0 ];
4164
- __clinic_args = PyTuple_New (nargs - 1 );
4165
- if (!__clinic_args ) {
4166
- goto exit ;
4167
- }
4168
- for (Py_ssize_t i = 0 ; i < nargs - 1 ; ++ i ) {
4169
- PyTuple_SET_ITEM (__clinic_args , i , Py_NewRef (args [1 + i ]));
4170
- }
4171
- return_value = test_vararg_and_posonly_impl (module , a , __clinic_args );
4166
+ __clinic_args = args + 1 ;
4167
+ return_value = test_vararg_and_posonly_impl (module , a , nvararg , __clinic_args );
4172
4168
4173
4169
exit :
4174
- Py_XDECREF (__clinic_args );
4175
4170
return return_value ;
4176
4171
}
4177
4172
4178
4173
static PyObject *
4179
- test_vararg_and_posonly_impl (PyObject * module , PyObject * a , PyObject * args )
4180
- /*[clinic end generated code: output=79b75dc07decc8d6 input=9cfa748bbff09877]*/
4174
+ test_vararg_and_posonly_impl (PyObject * module , PyObject * a , Py_ssize_t nargs ,
4175
+ PyObject * const * args )
4176
+ /*[clinic end generated code: output=dc2dd9483cc0459e input=9cfa748bbff09877]*/
4181
4177
4182
4178
/*[clinic input]
4183
4179
test_vararg
@@ -4931,14 +4927,14 @@ PyDoc_STRVAR(Test___init____doc__,
4931
4927
"Varargs init method. For example, nargs is translated to PyTuple_GET_SIZE." );
4932
4928
4933
4929
static int
4934
- Test___init___impl (TestObj * self , PyObject * args );
4930
+ Test___init___impl (TestObj * self , Py_ssize_t nargs , PyObject * const * args );
4935
4931
4936
4932
static int
4937
4933
Test___init__ (PyObject * self , PyObject * args , PyObject * kwargs )
4938
4934
{
4939
4935
int return_value = -1 ;
4940
4936
PyTypeObject * base_tp = TestType ;
4941
- PyObject * __clinic_args = NULL ;
4937
+ PyObject * const * __clinic_args = NULL ;
4942
4938
4943
4939
if ((Py_IS_TYPE (self , base_tp ) ||
4944
4940
Py_TYPE (self )-> tp_new == base_tp -> tp_new ) &&
@@ -4948,17 +4944,16 @@ Test___init__(PyObject *self, PyObject *args, PyObject *kwargs)
4948
4944
if (!_PyArg_CheckPositional ("Test" , PyTuple_GET_SIZE (args ), 0 , PY_SSIZE_T_MAX )) {
4949
4945
goto exit ;
4950
4946
}
4951
- __clinic_args = PyTuple_GetSlice ( 0 , -1 ) ;
4952
- return_value = Test___init___impl ((TestObj * )self , __clinic_args );
4947
+ __clinic_args = _PyTuple_CAST ( args ) -> ob_item ;
4948
+ return_value = Test___init___impl ((TestObj * )self , nvararg , __clinic_args );
4953
4949
4954
4950
exit :
4955
- Py_XDECREF (__clinic_args );
4956
4951
return return_value ;
4957
4952
}
4958
4953
4959
4954
static int
4960
- Test___init___impl (TestObj * self , PyObject * args )
4961
- /*[clinic end generated code: output=0ed1009fe0dcf98d input=2a8bd0033c9ac772]*/
4955
+ Test___init___impl (TestObj * self , Py_ssize_t nargs , PyObject * const * args )
4956
+ /*[clinic end generated code: output=6a64b417c9080a73 input=2a8bd0033c9ac772]*/
4962
4957
4963
4958
4964
4959
/*[clinic input]
@@ -4976,14 +4971,14 @@ PyDoc_STRVAR(Test__doc__,
4976
4971
"Varargs new method. For example, nargs is translated to PyTuple_GET_SIZE." );
4977
4972
4978
4973
static PyObject *
4979
- Test_impl (PyTypeObject * type , PyObject * args );
4974
+ Test_impl (PyTypeObject * type , Py_ssize_t nargs , PyObject * const * args );
4980
4975
4981
4976
static PyObject *
4982
4977
Test (PyTypeObject * type , PyObject * args , PyObject * kwargs )
4983
4978
{
4984
4979
PyObject * return_value = NULL ;
4985
4980
PyTypeObject * base_tp = TestType ;
4986
- PyObject * __clinic_args = NULL ;
4981
+ PyObject * const * __clinic_args = NULL ;
4987
4982
4988
4983
if ((type == base_tp || type -> tp_init == base_tp -> tp_init ) &&
4989
4984
!_PyArg_NoKeywords ("Test" , kwargs )) {
@@ -4992,17 +4987,16 @@ Test(PyTypeObject *type, PyObject *args, PyObject *kwargs)
4992
4987
if (!_PyArg_CheckPositional ("Test" , PyTuple_GET_SIZE (args ), 0 , PY_SSIZE_T_MAX )) {
4993
4988
goto exit ;
4994
4989
}
4995
- __clinic_args = PyTuple_GetSlice ( 0 , -1 ) ;
4996
- return_value = Test_impl (type , __clinic_args );
4990
+ __clinic_args = _PyTuple_CAST ( args ) -> ob_item ;
4991
+ return_value = Test_impl (type , nvararg , __clinic_args );
4997
4992
4998
4993
exit :
4999
- Py_XDECREF (__clinic_args );
5000
4994
return return_value ;
5001
4995
}
5002
4996
5003
4997
static PyObject *
5004
- Test_impl (PyTypeObject * type , PyObject * args )
5005
- /*[clinic end generated code: output=8b219f6633e2a2e9 input=70ad829df3dd9b84]*/
4998
+ Test_impl (PyTypeObject * type , Py_ssize_t nargs , PyObject * const * args )
4999
+ /*[clinic end generated code: output=bf22f942407383a5 input=70ad829df3dd9b84]*/
5006
5000
5007
5001
5008
5002
/*[clinic input]
0 commit comments