The lambda is never executed because it compiles to machine code and not Python byte code, but that shouldn't make a difference. You should still be able to use the AST of the body as input to the compiler.
And then a and b have to be pulled out of locals() automatically or something.
One other place I've seen this done is in the numexpr for Python.
https://github.com/pydata/numexpr
It does seem like this
could be The lambda is never executed because it compiles to machine code and not Python byte code, but that shouldn't make a difference. You should still be able to use the AST of the body as input to the compiler.And then a and b have to be pulled out of locals() automatically or something.