Python装饰器
装饰器
def demo(name):
print('demo--name', name)
def demo1(demo_name):
print('demo1--demoname', demo_name.__name__)
def demo2():
print('demo--name', name)
demo_name()
return demo2
return demo1
@demo('zhuangshiqi')
def test():
print('test')
test()