summaryrefslogtreecommitdiffstats
path: root/Objects/structseq.c
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2017-03-19 06:51:07 (GMT)
committerGitHub <noreply@github.com>2017-03-19 06:51:07 (GMT)
commit18b250f844bf8b2d1a81c2d2dcc74e850364fe35 (patch)
tree117c9240b5b87067a07cb43bc9260ed26c3148bb /Objects/structseq.c
parent0b5615926a573c19c887a701a2f7047f4fd06de6 (diff)
downloadcpython-18b250f844bf8b2d1a81c2d2dcc74e850364fe35.zip
cpython-18b250f844bf8b2d1a81c2d2dcc74e850364fe35.tar.gz
cpython-18b250f844bf8b2d1a81c2d2dcc74e850364fe35.tar.bz2
bpo-29793: Convert some builtin types constructors to Argument Clinic. (#615)
Diffstat (limited to 'Objects/structseq.c')
-rw-r--r--Objects/structseq.c24
1 files changed, 16 insertions, 8 deletions
diff --git a/Objects/structseq.c b/Objects/structseq.c
index c2ece5a..1b71f72 100644
--- a/Objects/structseq.c
+++ b/Objects/structseq.c
@@ -70,19 +70,27 @@ structseq_dealloc(PyStructSequence *obj)
PyObject_GC_Del(obj);
}
+/*[clinic input]
+class structseq "PyStructSequence *" "NULL"
+[clinic start generated code]*/
+/*[clinic end generated code: output=da39a3ee5e6b4b0d input=9d781c6922c77752]*/
+
+#include "clinic/structseq.c.h"
+
+/*[clinic input]
+@classmethod
+structseq.__new__ as structseq_new
+ sequence as arg: object
+ dict: object = NULL
+[clinic start generated code]*/
+
static PyObject *
-structseq_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
+structseq_new_impl(PyTypeObject *type, PyObject *arg, PyObject *dict)
+/*[clinic end generated code: output=baa082e788b171da input=9b44810243907377]*/
{
- PyObject *arg = NULL;
- PyObject *dict = NULL;
PyObject *ob;
PyStructSequence *res = NULL;
Py_ssize_t len, min_len, max_len, i, n_unnamed_fields;
- static char *kwlist[] = {"sequence", "dict", 0};
-
- if (!PyArg_ParseTupleAndKeywords(args, kwds, "O|O:structseq",
- kwlist, &arg, &dict))
- return NULL;
arg = PySequence_Fast(arg, "constructor requires a sequence");