On 26/02/21 3:21 pm, Celelibi wrote:
def twice(f): fun = CdefFunction(... use f ...) return funfoo = CdefFunction(...) ast.append(AstCdefFunction("foo", twice(foo))) I think this might even be doable without having to even detect the closure in cython. We'd just have to let python perform the name lookup.
The cdef function created inside twice() is going to have to be some kind of closure, because it needs access at run time to the particular f that was passed to twice() at compile time. -- Greg _______________________________________________ cython-devel mailing list [email protected] https://mail.python.org/mailman/listinfo/cython-devel
