def deco(func): def wrap(): print 'i am in deco' return func() return wrap @deco def test(): print "i am in test" when you run it ,there is no result , def deco(func): print 'i am in deco' return func() @deco def test(): print "i am in test" when you run it ,you can get : >>>i am in deco i am in test why?? -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.python.org/pipermail/python-list/attachments/20120110/3412bb95/attachment.html>