summaryrefslogtreecommitdiffstats
path: root/Modules/clinic
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2019-06-05 23:20:58 (GMT)
committerGitHub <noreply@github.com>2019-06-05 23:20:58 (GMT)
commit21ce2454de57caaa532d11d76544632608f4b86b (patch)
treecfd8c93784dbeda29b3f6733a2dd2073430ffce6 /Modules/clinic
parentd74438b633184bbd8d775d7118d6f12f6f825a96 (diff)
downloadcpython-21ce2454de57caaa532d11d76544632608f4b86b.zip
cpython-21ce2454de57caaa532d11d76544632608f4b86b.tar.gz
cpython-21ce2454de57caaa532d11d76544632608f4b86b.tar.bz2
bpo-37165: Convert _count_elements to the argument clinic (GH-13848)
(cherry picked from commit e985804207473796a1326585b3e1b9e18c764345) Co-authored-by: Raymond Hettinger <rhettinger@users.noreply.github.com>
Diffstat (limited to 'Modules/clinic')
-rw-r--r--Modules/clinic/_collectionsmodule.c.h33
1 files changed, 32 insertions, 1 deletions
diff --git a/Modules/clinic/_collectionsmodule.c.h b/Modules/clinic/_collectionsmodule.c.h
index ed3b1b5..c3ba1a6 100644
--- a/Modules/clinic/_collectionsmodule.c.h
+++ b/Modules/clinic/_collectionsmodule.c.h
@@ -2,6 +2,37 @@
preserve
[clinic start generated code]*/
+PyDoc_STRVAR(_collections__count_elements__doc__,
+"_count_elements($module, mapping, iterable, /)\n"
+"--\n"
+"\n"
+"Count elements in the iterable, updating the mapping");
+
+#define _COLLECTIONS__COUNT_ELEMENTS_METHODDEF \
+ {"_count_elements", (PyCFunction)(void(*)(void))_collections__count_elements, METH_FASTCALL, _collections__count_elements__doc__},
+
+static PyObject *
+_collections__count_elements_impl(PyObject *module, PyObject *mapping,
+ PyObject *iterable);
+
+static PyObject *
+_collections__count_elements(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ PyObject *mapping;
+ PyObject *iterable;
+
+ if (!_PyArg_CheckPositional("_count_elements", nargs, 2, 2)) {
+ goto exit;
+ }
+ mapping = args[0];
+ iterable = args[1];
+ return_value = _collections__count_elements_impl(module, mapping, iterable);
+
+exit:
+ return return_value;
+}
+
static PyObject *
tuplegetter_new_impl(PyTypeObject *type, Py_ssize_t index, PyObject *doc);
@@ -42,4 +73,4 @@ tuplegetter_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
exit:
return return_value;
}
-/*[clinic end generated code: output=51bd572577ca7111 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=9d2bfcc9df5faf35 input=a9049054013a1b77]*/