On 26/02/21 3:21 pm, Celelibi wrote:
def twice(f):
fun = CdefFunction(... use f ...)
return fun
foo = 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
cython-devel@python.org
https://mail.python.org/mailman/listinfo/cython-devel