小白不懂代码逻辑,求问!!
def log(prefix):
def log_decorator(f):
def wrapper(*args, **kw):
print ('[%s] %s()...' % (prefix, f.__name__))
return f(*args, **kw)
return wrapper
return log_decorator
@log('DEBUG')
def test():
pass
print (test())
#print(test())->print(log_decorator())->print(wrapper)
#???没有调用wrapper()为啥会执行里面的代码???