Cython:ctypedef函数?

Nik*_*s R 3 c c++ typedef function cython

是否可以ctypedef使用函数,因为它是C++中的常见模式?喜欢

typedef int (*foo)(int, double, char*)

# Cython equivalent
ctypedef int (*foo)(int, double, char*)
Run Code Online (Sandbox Code Playgroud)

或者至少在没有直接声明的情况下对它进行外设?类似的东西

# myheader.h
typedef int (*foo)(int, double, char*)

# mytest.pyx
extern int (*foo)
Run Code Online (Sandbox Code Playgroud)

orl*_*rlp 8

是的,完全可能:

ctypedef void (*function_type_name)(int, int)
Run Code Online (Sandbox Code Playgroud)