18 ms·
This is really cool. The AST transformation stuff here is neat, but relatively well-trodden ground. The more impressive new science here is the lazy_function
by ssanderson11235 12y ago
This is really cool. The AST transformation stuff here is neat, but relatively well-trodden ground.
The more impressive new science here is the lazy_function decorator, which is implemented as a bytecode transformer on the code object that lives inside the decorated function. The author built his own library for the bytecode stuff, which lives here: https://github.com/llllllllll/codetransformer https://github.com/llllllllll/codetransformer.