[BangPypers] decorator help

Prashant Gaur 91prashantgaur at gmail.com
Fri Sep 20 14:48:34 CEST 2013


Hello Babmis ,

Please check below code.
Let me know if i am wrong.


def track(urfunc):
    def loggingfun():
        print "enter " ,  urfunc.__name__
        outcome = urfunc()
        print "exit ",  urfunc.__name__

        return outcome
    loggingfun.__name__ =  urfunc .__name__
    loggingfun.__doc__ =  urfunc .__doc__
    return loggingfun


More information about the BangPypers mailing list