On Friday, September 20, 2013 6:29:55 PM UTC+5:30, bab mis wrote: > def fun: > > print "entry" > > . > > . > > print "
On Friday, September 20, 2013 6:29:55 PM UTC+5:30, bab mis wrote: > def fun: > > print "entry" > > . > > . > > print "exit" On Friday, September 20, 2013 6:29:55 PM UTC+5:30, bab mis wrote: > def fun: > > print "entry" > > . > > . > > print "exit" Peter couple of queries with following code : def funlog(f): def g(*args,**kw): print "enter", f.__name__ try: return f(*args, **kw) finally: print "exit", f.__name__ return g class Action: def __init__(self): pass @funlog def sret(self): pass @funlog def ping(self): pass def verifyerun(self): pass 1) funlog is called for the last function as well. 2) Is it a proper way to define decorator out of class and use it . -- https://mail.python.org/mailman/listinfo/python-list