summaryrefslogtreecommitdiffstats
path: root/contrib/tools/python3/Modules/clinic/arraymodule.c.h
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/tools/python3/Modules/clinic/arraymodule.c.h')
-rw-r--r--contrib/tools/python3/Modules/clinic/arraymodule.c.h36
1 files changed, 22 insertions, 14 deletions
diff --git a/contrib/tools/python3/Modules/clinic/arraymodule.c.h b/contrib/tools/python3/Modules/clinic/arraymodule.c.h
index 844865f44a5..1046355dc38 100644
--- a/contrib/tools/python3/Modules/clinic/arraymodule.c.h
+++ b/contrib/tools/python3/Modules/clinic/arraymodule.c.h
@@ -3,10 +3,28 @@ preserve
[clinic start generated code]*/
#if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
-# include "pycore_gc.h" // PyGC_Head
-# include "pycore_runtime.h" // _Py_ID()
+# include "pycore_runtime.h" // _Py_SINGLETON()
#endif
+#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"
@@ -445,10 +463,6 @@ array_array_frombytes(arrayobject *self, PyObject *arg)
if (PyObject_GetBuffer(arg, &buffer, PyBUF_SIMPLE) != 0) {
goto exit;
}
- if (!PyBuffer_IsContiguous(&buffer, 'C')) {
- _PyArg_BadArgument("frombytes", "argument", "contiguous buffer", arg);
- goto exit;
- }
return_value = array_array_frombytes_impl(self, &buffer);
exit:
@@ -504,9 +518,6 @@ array_array_fromunicode(arrayobject *self, PyObject *arg)
_PyArg_BadArgument("fromunicode", "argument", "str", arg);
goto exit;
}
- if (PyUnicode_READY(arg) == -1) {
- goto exit;
- }
ustr = arg;
return_value = array_array_fromunicode_impl(self, ustr);
@@ -587,15 +598,12 @@ array__array_reconstructor(PyObject *module, PyObject *const *args, Py_ssize_t n
_PyArg_BadArgument("_array_reconstructor", "argument 2", "a unicode character", args[1]);
goto exit;
}
- if (PyUnicode_READY(args[1])) {
- goto exit;
- }
if (PyUnicode_GET_LENGTH(args[1]) != 1) {
_PyArg_BadArgument("_array_reconstructor", "argument 2", "a unicode character", args[1]);
goto exit;
}
typecode = PyUnicode_READ_CHAR(args[1], 0);
- mformat_code = _PyLong_AsInt(args[2]);
+ mformat_code = PyLong_AsInt(args[2]);
if (mformat_code == -1 && PyErr_Occurred()) {
goto exit;
}
@@ -680,4 +688,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=7478fe6a5e4096f5 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=f675e0d433ae34b6 input=a9049054013a1b77]*/