Branch data Line data Source code
1 : : /*[clinic input]
2 : : preserve
3 : : [clinic start generated code]*/
4 : :
5 : : #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
6 : : # include "pycore_gc.h" // PyGC_Head
7 : : # include "pycore_runtime.h" // _Py_ID()
8 : : #endif
9 : :
10 : :
11 : : static PyObject *
12 : : pysqlite_row_new_impl(PyTypeObject *type, pysqlite_Cursor *cursor,
13 : : PyObject *data);
14 : :
15 : : static PyObject *
16 : 0 : pysqlite_row_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
17 : : {
18 : 0 : PyObject *return_value = NULL;
19 : 0 : PyTypeObject *base_tp = clinic_state()->RowType;
20 : : pysqlite_Cursor *cursor;
21 : : PyObject *data;
22 : :
23 [ # # # # : 0 : if ((type == base_tp || type->tp_init == base_tp->tp_init) &&
# # ]
24 [ # # ]: 0 : !_PyArg_NoKeywords("Row", kwargs)) {
25 : 0 : goto exit;
26 : : }
27 [ # # # # : 0 : if (!_PyArg_CheckPositional("Row", PyTuple_GET_SIZE(args), 2, 2)) {
# # ]
28 : 0 : goto exit;
29 : : }
30 [ # # ]: 0 : if (!PyObject_TypeCheck(PyTuple_GET_ITEM(args, 0), clinic_state()->CursorType)) {
31 : 0 : _PyArg_BadArgument("Row", "argument 1", (clinic_state()->CursorType)->tp_name, PyTuple_GET_ITEM(args, 0));
32 : 0 : goto exit;
33 : : }
34 : 0 : cursor = (pysqlite_Cursor *)PyTuple_GET_ITEM(args, 0);
35 [ # # ]: 0 : if (!PyTuple_Check(PyTuple_GET_ITEM(args, 1))) {
36 : 0 : _PyArg_BadArgument("Row", "argument 2", "tuple", PyTuple_GET_ITEM(args, 1));
37 : 0 : goto exit;
38 : : }
39 : 0 : data = PyTuple_GET_ITEM(args, 1);
40 : 0 : return_value = pysqlite_row_new_impl(type, cursor, data);
41 : :
42 : 0 : exit:
43 : 0 : return return_value;
44 : : }
45 : :
46 : : PyDoc_STRVAR(pysqlite_row_keys__doc__,
47 : : "keys($self, /)\n"
48 : : "--\n"
49 : : "\n"
50 : : "Returns the keys of the row.");
51 : :
52 : : #define PYSQLITE_ROW_KEYS_METHODDEF \
53 : : {"keys", (PyCFunction)pysqlite_row_keys, METH_NOARGS, pysqlite_row_keys__doc__},
54 : :
55 : : static PyObject *
56 : : pysqlite_row_keys_impl(pysqlite_Row *self);
57 : :
58 : : static PyObject *
59 : 0 : pysqlite_row_keys(pysqlite_Row *self, PyObject *Py_UNUSED(ignored))
60 : : {
61 : 0 : return pysqlite_row_keys_impl(self);
62 : : }
63 : : /*[clinic end generated code: output=157b31ac3f6af1ba input=a9049054013a1b77]*/
|