装饰器
def proxy(func):
def around():
print("@Before")
func()
print("@After")
return around
def func():
print("func")
proxy(func)()
def proxy(func):
def around():
print("@Before")
func()
print("@After")
return around
@proxy
def func():
print("func")
func()