文章详情

  • 游戏榜单
  • 软件榜单
关闭导航
热搜榜
热门下载
热门标签
php爱好者> php文档>python的decorator

python的decorator

时间:2010-11-23  来源:cornsea

 

def abc(fun):
    def myfun():
        print "abc"
        fun()
    return myfun

@abc
def test():
    print "test"

print test
test()
我这里的输出是:

<function myfun at 0xb7598a74>
abc
test

:)

相关阅读 更多 +
排行榜 更多 +
萌趣贪吃蛇

萌趣贪吃蛇

休闲益智 下载
火柴人超级战车安卓版

火柴人超级战车安卓版

飞行射击 下载
火箭少女特种兵最新版

火箭少女特种兵最新版

飞行射击 下载