8
8
#endif
9
9
10
10
/*[clinic input]
11
+ module _collections
11
12
class _tuplegetter "_tuplegetterobject *" "&tuplegetter_type"
12
13
[clinic start generated code]*/
13
- /*[clinic end generated code: output=da39a3ee5e6b4b0d input=ee5ed5baabe35068 ]*/
14
+ /*[clinic end generated code: output=da39a3ee5e6b4b0d input=a8ece4ccad7e30ac ]*/
14
15
15
16
static PyTypeObject tuplegetter_type ;
16
17
#include "clinic/_collectionsmodule.c.h"
@@ -2228,17 +2229,24 @@ static PyTypeObject defdict_type = {
2228
2229
2229
2230
/* helper function for Counter *********************************************/
2230
2231
2231
- PyDoc_STRVAR (_count_elements_doc ,
2232
- "_count_elements(mapping, iterable) -> None\n\
2233
- \n\
2234
- Count elements in the iterable, updating the mapping" );
2232
+ /*[clinic input]
2233
+ _collections._count_elements
2234
+
2235
+ mapping: object
2236
+ iterable: object
2237
+ /
2238
+
2239
+ Count elements in the iterable, updating the mapping
2240
+ [clinic start generated code]*/
2235
2241
2236
2242
static PyObject *
2237
- _count_elements (PyObject * self , PyObject * args )
2243
+ _collections__count_elements_impl (PyObject * module , PyObject * mapping ,
2244
+ PyObject * iterable )
2245
+ /*[clinic end generated code: output=7e0c1789636b3d8f input=e79fad04534a0b45]*/
2238
2246
{
2239
2247
_Py_IDENTIFIER (get );
2240
2248
_Py_IDENTIFIER (__setitem__ );
2241
- PyObject * it , * iterable , * mapping , * oldval ;
2249
+ PyObject * it , * oldval ;
2242
2250
PyObject * newval = NULL ;
2243
2251
PyObject * key = NULL ;
2244
2252
PyObject * bound_get = NULL ;
@@ -2247,9 +2255,6 @@ _count_elements(PyObject *self, PyObject *args)
2247
2255
PyObject * mapping_setitem ;
2248
2256
PyObject * dict_setitem ;
2249
2257
2250
- if (!PyArg_UnpackTuple (args , "_count_elements" , 2 , 2 , & mapping , & iterable ))
2251
- return NULL ;
2252
-
2253
2258
it = PyObject_GetIter (iterable );
2254
2259
if (it == NULL )
2255
2260
return NULL ;
@@ -2510,7 +2515,7 @@ PyDoc_STRVAR(module_doc,
2510
2515
" );
2511
2516
2512
2517
static struct PyMethodDef module_functions [] = {
2513
- { "_count_elements" , _count_elements , METH_VARARGS , _count_elements_doc },
2518
+ _COLLECTIONS__COUNT_ELEMENTS_METHODDEF
2514
2519
{NULL , NULL } /* sentinel */
2515
2520
};
2516
2521
0 commit comments