标签:python装饰器 col python 嵌套 auth turn author nbsp def
另一种实现方式:
1 __author__ = "csy" 2 3 def test2(func): 4 def test1(): 5 func() 6 print(func) 7 return test1 8 9 def bar2(): 10 print(‘in the bar2‘) 11 12 bar2 = test2(bar2) # test2将bar2作为变量在嵌套函数test1中调用,再将test1的内存地址作为返回值重新赋给bar2 13 bar2()
标签:python装饰器 col python 嵌套 auth turn author nbsp def
原文地址:http://www.cnblogs.com/csy113/p/7467358.html