Re: decorator problem1:

2012-01-09 Thread Chris Rebert
On Mon, Jan 9, 2012 at 7:59 PM, contro opinion wrote: > test1.py > > def deco(func): >    print 'i am in deco' >    return func > > @deco > > def test(): >   print 'i am in test' > > when you run it ,you get : > > > > test2.py > > def tsfunc(func): >     def wrappedFunc(): >     print '[%s] %s

decorator problem1:

2012-01-09 Thread contro opinion
test1.py def deco(func): print 'i am in deco' return func @deco def test(): print 'i am in test' when you run it ,you get : test2.py def tsfunc(func): def wrappedFunc(): print '[%s] %s() called' % (ctime(), func.__name__) print 'i am in deco' return func(