ITeye博客

Python decorator

aaron_ch · 2011-11-03 22:31 · Python · 编程语言 · Markdown

#decorator def before(func): def wapper(*args): print "print before invoke foo function" func(*args) print "print after invoke foo function" return wapper

@before def foo(x): print "this is dummy function" + x

foo("mm")

评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。