In my module there is a method that takes python list and divides it by double
static PyObject *st_div_r(PyObject *self, PyObject *args){
  PyObject *pList;
  Py_ssize_t n;
  double x;
  int i;
  if (!PyArg_ParseTuple(args, "O!d", &PyList_Type, &pList, &x)) {
    PyErr_SetString(PyExc_TypeError, "parameters are wrong.");
    return NULL;
    }
  n = PyList_Size(pList);
  for(i=0;i<n;i++)
  {
    PyList_SetItem(pList,i,Py_BuildValue("d",PyFloat_AsDouble(PyList_GetItem(pList,i))/x));
        };
  Py_INCREF(pList);
  return pList;
}
It works like this
my_mod.st_div_r([1,2,3],0.5)
[2,4,6]
I would like to use st_div_r in another method in my module, that takes list of lists, divides it's first element by double and returns it
static PyObject *det(PyObject *self, PyObject *args){ 
  PyObject *pList;
  double d = 2.0;
  if (!PyArg_ParseTuple(args, "O!", &PyList_Type, &pList)) {
    PyErr_SetString(PyExc_TypeError, "parameters are  wrong.");
    return NULL;
    }
  PyList_SetItem(pList,0,st_div_r(pList,(PyList_GetItem(pList,0),Py_BuildValue("d",d))));
  Py_INCREF(pList);
  return pList;
}
It should work like this
my_mod.det([[1,2],[3,4]])
[[0.5,1],[3,4]]
But this doesn't work
 TypeError: parameters are wrong
So, the question is how to call st_div_r inside det and what to pass as self. Would appreciate any help. Thank you
