Код: Выделить всё
def before_run(func):
print "hello from before run"
def handle_arg(a,b):
if(a>0):
a= 100
return func(a,b)
return handle_arg
@before_run
def running_func(a,b):
print "a",a,"b", b
return a+b
Подробнее здесь: https://stackoverflow.com/questions/286 ... or-factory