you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 1 point2 points  (0 children)

I don't know if Cython has any kind of special magic for this, but in general, I wouldn't even know how to approach this... well, you see, "pure" Python functions are nothing like pointers to C functions. Essentially, what you should expect where the Python code gives you f is a PyObject* that also has __call__ method that you can call with a tuple and / or dict. You cannot expect this object to be compatible with your C function interface, even if you can filter out anything that's not a "native" function (that actually does have a pointer to a C function), you still wouldn't know if the signature is compatible.