[Cython] [ENH] Compile-time code execution (macros / templates)

Greg Ewing greg.ewing at canterbury.ac.nz
Thu Feb 25 19:32:34 EST 2021


On 26/02/21 9:29 am, Celelibi wrote:
> Maybe in the future if cython
> support compiling closures to C?

Your "twice" example already needs some closure functionality.
It relies on being able to manufacture a cdef function inside
a Python function, with the expectation that it will have
access to arguments of the Python function. With all or some
of that happening at compile time rather than run time. I'm
having trouble imagining how it would be implemented.

-- 
Greg



More information about the cython-devel mailing list