test1.py<br><br>def deco(func):<br> print 'i am in deco'<br> return func <br><br>@deco<br><br>def test():<br> print 'i am in test'<br><br>when you run it ,you get :<br><br><br><br>test2.py<br><br>def tsfunc(func):<br>
def wrappedFunc():<br> print '[%s] %s() called' % (ctime(), func.__name__)<br> print 'i am in deco'<br> return func()<br> return wrappedFunc<br><br>@tsfunc<br>def test():<br> print "i am in test"<br>
<br>when you run test2.py,you can get nothing ,why can't i get :??<br>i am in deco <br><br>