1 2 3 4 5 6 7 8 9
cdef struct Bar: int sum(int a, int b) cdef int add(int a, int b): return a + b cdef Bar bar = Bar(add) print(bar.sum(1, 2))