title: Cython Create C Function Alias
body: <p>I have two variants of a function: <code>void func1(double *)</code> and <code>void func2(double *)</code> that are externed from C++ code.</p>
  
  <p>I want to be able to write a function or mapping that wraps them:</p>
  
  <pre><code>cdef func_alias(int choice):
     if choice == 0:
         return func1
     elif choice == 1:
         return func2
  </code></pre>
  
  <p>But compiling <code>Cannot convert 'void (double *) nogil' to Python object</code></p>
  
  <p>Alternatively I have tried using dicts which produces the same error:</p>
  
  <pre><code>cdef dict func_dict = {0: func1, 1: func2}
  </code></pre>
  
  <p>But I get the same error.</p>
  
  <p>I am not sure if I can do something along the lines of</p>
  
  <pre><code>from libcpp.map import map
  cdef map[int, void] func_map = {0: func1, 1: func2}
  </code></pre>
  
  <p>which results in <code>Cannot interpret dict as type 'map[int,void]'</code></p>