blob: b3b4836543d05f6a861d704576a0dc4b576d87b4 [file] [log] [blame]
Serhiy Storchaka18b250f2017-03-19 08:51:07 +02001/*[clinic input]
2preserve
3[clinic start generated code]*/
4
5static PyObject *
6structseq_new_impl(PyTypeObject *type, PyObject *arg, PyObject *dict);
7
8static PyObject *
9structseq_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
10{
11 PyObject *return_value = NULL;
12 static const char * const _keywords[] = {"sequence", "dict", NULL};
Serhiy Storchaka31913912019-03-14 10:32:22 +020013 static _PyArg_Parser _parser = {NULL, _keywords, "structseq", 0};
14 PyObject *argsbuf[2];
15 PyObject * const *fastargs;
16 Py_ssize_t nargs = PyTuple_GET_SIZE(args);
17 Py_ssize_t noptargs = nargs + (kwargs ? PyDict_GET_SIZE(kwargs) : 0) - 1;
Serhiy Storchaka18b250f2017-03-19 08:51:07 +020018 PyObject *arg;
19 PyObject *dict = NULL;
20
Serhiy Storchaka31913912019-03-14 10:32:22 +020021 fastargs = _PyArg_UnpackKeywords(_PyTuple_CAST(args)->ob_item, nargs, kwargs, NULL, &_parser, 1, 2, 0, argsbuf);
22 if (!fastargs) {
Serhiy Storchaka18b250f2017-03-19 08:51:07 +020023 goto exit;
24 }
Serhiy Storchaka31913912019-03-14 10:32:22 +020025 arg = fastargs[0];
26 if (!noptargs) {
27 goto skip_optional_pos;
28 }
29 dict = fastargs[1];
30skip_optional_pos:
Serhiy Storchaka18b250f2017-03-19 08:51:07 +020031 return_value = structseq_new_impl(type, arg, dict);
32
33exit:
34 return return_value;
35}
Serhiy Storchaka31913912019-03-14 10:32:22 +020036/*[clinic end generated code: output=ed3019acf49b656c input=a9049054013a1b77]*/