[Python-ideas] Add specialized bytecode with guards to functions

Random832 random832 at fastmail.com
Wed Oct 21 22:00:41 CEST 2015


Andrew Barnert via Python-ideas
<python-ideas at python.org> writes:
> Nested functions are just like top-level functions:

The point is that my suggested feature is a decorator (or decorator-like
function) attached to the function, to modify the function to replace
free variables with constants. This means if the decorator is attached
to the inner function it gets executed every time the outer function is
executed, and if it is attached to the outer function we have to decide
whether it will walk through that function's inner functions and change
them too.



More information about the Python-ideas mailing list