This little line right here solved a problem. How do you dynamically assign a function to a variable to be invoked later but you need it to have a preset value? Define it when you assign it. I just didn’t know you could do that with lambda functions. Cool! This was used to update my version of the web2py shell. More on that in a sec.
f = lambda x: (lambda result=range(20):do_something(result,x))()