I am rephrasing my original question based on some of the comments (I recognized that when posted the question was not as precise as it could have been) in the hopes to find a answer.
I have the following cdef function that among various other parameters accepts an f() function defined as an ftype as shown below,
%%cython
ctypedef double (*ftype) (double)
cdef cy_myfunc(int a,..., double x, ftype f):
...
cdef double result
result = f(x)
return result
and I define a python function such as this:
def py_myfunc(a,..., x, f):
return cy_myfunc(a,...,x,f)
I want to be able to call py_myfunc() and pass a user python function as the f parameter (the only prerequisite of the python function is that is should accept a double and return double). Is this possible? if so how can this be achieved in cython? The f() function is used repeatedly within a loop so I would like for it to be as quick as possible.