学无止境

少年辛苦终身事,莫向光阴惰寸功。——唐·杜荀鹤《题弟侄书堂》


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()