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