文章详情

  • 游戏榜单
  • 软件榜单
关闭导航
热搜榜
热门下载
热门标签
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

:)

相关阅读 更多 +
排行榜 更多 +
方块猎人内置修改器

方块猎人内置修改器

飞行射击 下载
方块猎人无限金币子弹版

方块猎人无限金币子弹版

飞行射击 下载
小兵大作战无限内购版

小兵大作战无限内购版

休闲益智 下载