i have a c++ class A , it will callback a python function foo(A) , and i want to send a A* pointer to this function , how can i do it ? my code is similar as follow :
PyObject* arg = (PyObject*)(pA);
PyTuple_SetItem(args, 0, arg);
PyObject* pRet = PyObject_CallObject(foo, args);
but it always crash , seems wrap arg from A* is not correct , can anybody help me ?
Aobject is a Python object! The cast should be a red flag. Moreover, what do you want the Python function to do with the pointer?