文章详情

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

:)

相关阅读 更多 +
排行榜 更多 +
飞艇大战

飞艇大战

飞行射击 下载
三维空间战斗机

三维空间战斗机

飞行射击 下载
战斗机教练

战斗机教练

飞行射击 下载