I have code like the following:
PyObject *callback; PyObject *paths; // Process and convert arguments if (!PyArg_ParseTuple(args, "OO:schedule", &paths, &callback)) return NULL;
What exactly is going on inside PyArg_ParseTuple? I assume that the callback gets the function pointer that I passed to args (also PyObject *). How does PyArg_ParseTuple convert a function pointer to PyObject *?
What I want to know is what happens if I double-go into the same callback function pointer. I think callback gets a new PyObject inside PyArg_ParseTuple, so each time it will get a different memory address, but it will contain the same callback function pointer.
But if I call the PyObject_Hash callback, it will produce a different value every time, right? (since the address is different every time ..)
source share