Returning a tuple of multipe objects in Python C API
- by celil
I am writing a native function that will return multiple Python objects
PyObject *V = PyList_New(0);
PyObject *E = PyList_New(0);
PyObject *F = PyList_New(0);
return Py_BuildValue("ooo", V, E, F);
This compiles fine, however, when I call it from a Python program, I get an error:
SystemError: bad format char passed to Py_BuildValue
How can…