Skip to content Skip to sidebar Skip to footer

Error When Compiling Cpython: Cannot Convert From Pylongobject To Pyobject

I've been trying to learn to use CPython and for it, I tried creating a simple factorial function. Here is the function: /* long factorial(long number){ long output = 1; f

Solution 1:

C-Api reference

Check the documentation.

PyObject* PyObject_RichCompare(PyObject *o1, PyObject *o2, int opid)

First and second arguments are of type PyObject*, earlier you were passing PyLongObject. i.e. i and number

Compiler was telling you exactly that. Same explanation goes for other function calls as well. When you changed the code, all the function calls are now receiving parameters with expected type.

Post a Comment for "Error When Compiling Cpython: Cannot Convert From Pylongobject To Pyobject"