title: How to call a cython cdef() function that contains as a parameter a function in python?
body: <p>I have a cdef function that has amongst its parameters a function. I am trying to generate a python 'wrapper' function that will call it. I know that defining a function as cpdef() I would be able to get access to a python version of the function. However, if I do this, I will get an error (as expected) that says that python cannot recognize the function definition I provided.  </p>
  
  <p>Any suggestions?</p>
  
  <p>My original function is domain specific and quite long but I think that the following example captures what I am after. I would have the following <strong>cdef()</strong> function defined,</p>
  
  <pre class="lang-py prettyprint-override"><code>ctypedef double (*ftype) (double)
  
  cdef cy_myfunc(int a,..., double x, ftype f):
    ...
    cdef double result
    result = f(x)
  
    return result
  </code></pre>
  
  <p>and I would like to define something like the following so that I can call it in python:</p>
  
  <pre><code>def py_myfunc(a,..., x, f):
      return cy_myfunc(a,...,x,f)
  </code></pre>