test1.py<br><br>def deco(func):<br> print 'i am in deco' <br><br>@deco<br>def test():<br> print 'i am in test'<br><br><br>when you run it ,you get :<br>i am in deco<br><br><br><br>test2.py<br><br>
def tsfunc(func):<br> def wrappedFunc():<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