code1:<br><br>def FirstDeco(func):<br> print 'haha'<br> y=func()<br> return y<br> print y<br> <br><br>@FirstDeco<br>def test():<br> print 'asdf'<br> return 7<br><br>result :<br>haha<br>asdf<br><br>
code2:<br><br>def FirstDeco(func):<br> print 'haha'<br> y=func()<br> #return y<br> print y<br> <br><br>@FirstDeco<br>def test():<br> print 'asdf'<br> return 7<br><br>result :<br>haha<br>asdf<br>
7<br><br>why the result of code1 and code2 is different?<br><br>