Quote:
|
Originally Posted by Cerulean
Where `function(anon)` does what exactly?
|
Uh, well, 'function' is a function, and 'anon' is the inline function defined in my example. For instance:
def print_output(func):
print func(10)
def increment(x):
return x + 1
print_output(increment) Could have some syntactic sugar that would allow it to be re-written:
def print_output(func):
print func(10)
use x in print_output:
return x + 1