Python装饰器笔记
时间:2014-07-22 23:10:25
收藏:0
阅读:460
def small(func): def getfunc(): print "<small>" func() print "</small>" return getfunc def strong(func): def getfunc(): print "<strong>" func() print "</strong>" return getfunc def text(text="HELLO WORLD"): print text # newtext=small(strong(text)) # newtext() @small @strong def text1(text="HELLO WORLD"): print text text1()
原文:http://www.cnblogs.com/Xjng/p/3514791.html
评论(0)
