#coding=utf-8
@doco
def foo():
pass
'''
deco把foo函数拿过来,加上一些额外的功能再重新赋值给foo,如下
'''
foo=deco(foo)
def log(func):
def wrappedFunc():
print "*** %s() called" % func.__name__
return func()
return wrappedFunc
@log
def foo():
print "inside foo()"
foo()