(root)/
Python-3.12.0/
Modules/
_sqlite/
clinic/
row.c.h
       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  pysqlite_row_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
      17  {
      18      PyObject *return_value = NULL;
      19      PyTypeObject *base_tp = clinic_state()->RowType;
      20      pysqlite_Cursor *cursor;
      21      PyObject *data;
      22  
      23      if ((type == base_tp || type->tp_init == base_tp->tp_init) &&
      24          !_PyArg_NoKeywords("Row", kwargs)) {
      25          goto exit;
      26      }
      27      if (!_PyArg_CheckPositional("Row", PyTuple_GET_SIZE(args), 2, 2)) {
      28          goto exit;
      29      }
      30      if (!PyObject_TypeCheck(PyTuple_GET_ITEM(args, 0), clinic_state()->CursorType)) {
      31          _PyArg_BadArgument("Row", "argument 1", (clinic_state()->CursorType)->tp_name, PyTuple_GET_ITEM(args, 0));
      32          goto exit;
      33      }
      34      cursor = (pysqlite_Cursor *)PyTuple_GET_ITEM(args, 0);
      35      if (!PyTuple_Check(PyTuple_GET_ITEM(args, 1))) {
      36          _PyArg_BadArgument("Row", "argument 2", "tuple", PyTuple_GET_ITEM(args, 1));
      37          goto exit;
      38      }
      39      data = PyTuple_GET_ITEM(args, 1);
      40      return_value = pysqlite_row_new_impl(type, cursor, data);
      41  
      42  exit:
      43      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  pysqlite_row_keys(pysqlite_Row *self, PyObject *Py_UNUSED(ignored))
      60  {
      61      return pysqlite_row_keys_impl(self);
      62  }
      63  /*[clinic end generated code: output=157b31ac3f6af1ba input=a9049054013a1b77]*/