I'm writing a Python Module using the C extension API and am trying to pass a long variable from Python into the C function and then from that get the raw PyLongObject used to represent this variable.
I'm using the PyArg_Parse function to parse the variable into a raw C Pointer. I'm expecting the PyObject returned to be of type PyLongObject, however whenever I inspect the value of the typename for the parsed object its always of type 'frame'? What am I missing?
static PyObject* test(PyObject *self, PyObject *args)
{
PyObject *num;
if(!PyArg_Parse(args, "0", &num))
{
//ERROR YO
}
printf("\n%s\n", num->ob_type->tp_name);
Py_RETURN_NONE;
}