@@ -4148,36 +4148,32 @@ PyDoc_STRVAR(test_vararg_and_posonly__doc__,
41484148 {"test_vararg_and_posonly", _PyCFunction_CAST(test_vararg_and_posonly), METH_FASTCALL, test_vararg_and_posonly__doc__},
41494149
41504150static 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 );
41524153
41534154static PyObject *
41544155test_vararg_and_posonly (PyObject * module , PyObject * const * args , Py_ssize_t nargs )
41554156{
41564157 PyObject * return_value = NULL ;
4158+ Py_ssize_t nvararg = nargs - 1 ;
41574159 PyObject * a ;
4158- PyObject * __clinic_args = NULL ;
4160+ PyObject * const * __clinic_args = NULL ;
41594161
41604162 if (!_PyArg_CheckPositional ("test_vararg_and_posonly" , nargs , 1 , PY_SSIZE_T_MAX )) {
41614163 goto exit ;
41624164 }
41634165 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 );
41724168
41734169exit :
4174- Py_XDECREF (__clinic_args );
41754170 return return_value ;
41764171}
41774172
41784173static 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]*/
41814177
41824178/*[clinic input]
41834179test_vararg
@@ -4931,14 +4927,14 @@ PyDoc_STRVAR(Test___init____doc__,
49314927"Varargs init method. For example, nargs is translated to PyTuple_GET_SIZE." );
49324928
49334929static int
4934- Test___init___impl (TestObj * self , PyObject * args );
4930+ Test___init___impl (TestObj * self , Py_ssize_t nargs , PyObject * const * args );
49354931
49364932static int
49374933Test___init__ (PyObject * self , PyObject * args , PyObject * kwargs )
49384934{
49394935 int return_value = -1 ;
49404936 PyTypeObject * base_tp = TestType ;
4941- PyObject * __clinic_args = NULL ;
4937+ PyObject * const * __clinic_args = NULL ;
49424938
49434939 if ((Py_IS_TYPE (self , base_tp ) ||
49444940 Py_TYPE (self )-> tp_new == base_tp -> tp_new ) &&
@@ -4948,17 +4944,16 @@ Test___init__(PyObject *self, PyObject *args, PyObject *kwargs)
49484944 if (!_PyArg_CheckPositional ("Test" , PyTuple_GET_SIZE (args ), 0 , PY_SSIZE_T_MAX )) {
49494945 goto exit ;
49504946 }
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 );
49534949
49544950exit :
4955- Py_XDECREF (__clinic_args );
49564951 return return_value ;
49574952}
49584953
49594954static 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]*/
49624957
49634958
49644959/*[clinic input]
@@ -4976,14 +4971,14 @@ PyDoc_STRVAR(Test__doc__,
49764971"Varargs new method. For example, nargs is translated to PyTuple_GET_SIZE." );
49774972
49784973static PyObject *
4979- Test_impl (PyTypeObject * type , PyObject * args );
4974+ Test_impl (PyTypeObject * type , Py_ssize_t nargs , PyObject * const * args );
49804975
49814976static PyObject *
49824977Test (PyTypeObject * type , PyObject * args , PyObject * kwargs )
49834978{
49844979 PyObject * return_value = NULL ;
49854980 PyTypeObject * base_tp = TestType ;
4986- PyObject * __clinic_args = NULL ;
4981+ PyObject * const * __clinic_args = NULL ;
49874982
49884983 if ((type == base_tp || type -> tp_init == base_tp -> tp_init ) &&
49894984 !_PyArg_NoKeywords ("Test" , kwargs )) {
@@ -4992,17 +4987,16 @@ Test(PyTypeObject *type, PyObject *args, PyObject *kwargs)
49924987 if (!_PyArg_CheckPositional ("Test" , PyTuple_GET_SIZE (args ), 0 , PY_SSIZE_T_MAX )) {
49934988 goto exit ;
49944989 }
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 );
49974992
49984993exit :
4999- Py_XDECREF (__clinic_args );
50004994 return return_value ;
50014995}
50024996
50034997static 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]*/
50065000
50075001
50085002/*[clinic input]
0 commit comments