summaryrefslogtreecommitdiffstats
path: root/Modules/clinic
diff options
context:
space:
mode:
authorMike Zimin <122507876+mikeziminio@users.noreply.github.com>2024-02-10 15:59:46 (GMT)
committerGitHub <noreply@github.com>2024-02-10 15:59:46 (GMT)
commit9d1a353230f555fc28239c5ca1e82b758084e02a (patch)
tree55d1b4e09e8661e085c935b61fecdf84ade80ba7 /Modules/clinic
parent5319c66550a6d6c6698dea75c0a0ee005873ce61 (diff)
downloadcpython-9d1a353230f555fc28239c5ca1e82b758084e02a.zip
cpython-9d1a353230f555fc28239c5ca1e82b758084e02a.tar.gz
cpython-9d1a353230f555fc28239c5ca1e82b758084e02a.tar.bz2
gh-114894: add array.array.clear() method (#114919)
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com> Co-authored-by: AN Long <aisk@users.noreply.github.com> Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
Diffstat (limited to 'Modules/clinic')
-rw-r--r--Modules/clinic/arraymodule.c.h20
1 files changed, 19 insertions, 1 deletions
diff --git a/Modules/clinic/arraymodule.c.h b/Modules/clinic/arraymodule.c.h
index 0b764e4..60a03fe 100644
--- a/Modules/clinic/arraymodule.c.h
+++ b/Modules/clinic/arraymodule.c.h
@@ -5,6 +5,24 @@ preserve
#include "pycore_abstract.h" // _PyNumber_Index()
#include "pycore_modsupport.h" // _PyArg_CheckPositional()
+PyDoc_STRVAR(array_array_clear__doc__,
+"clear($self, /)\n"
+"--\n"
+"\n"
+"Remove all items from the array.");
+
+#define ARRAY_ARRAY_CLEAR_METHODDEF \
+ {"clear", (PyCFunction)array_array_clear, METH_NOARGS, array_array_clear__doc__},
+
+static PyObject *
+array_array_clear_impl(arrayobject *self);
+
+static PyObject *
+array_array_clear(arrayobject *self, PyObject *Py_UNUSED(ignored))
+{
+ return array_array_clear_impl(self);
+}
+
PyDoc_STRVAR(array_array___copy____doc__,
"__copy__($self, /)\n"
"--\n"
@@ -667,4 +685,4 @@ PyDoc_STRVAR(array_arrayiterator___setstate____doc__,
#define ARRAY_ARRAYITERATOR___SETSTATE___METHODDEF \
{"__setstate__", (PyCFunction)array_arrayiterator___setstate__, METH_O, array_arrayiterator___setstate____doc__},
-/*[clinic end generated code: output=3be987238a4bb431 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=52c55d9b1d026c1c input=a9049054013a1b77]*/