I can access a python function's attribute inside of function itself by below code:
def aa(): print aa.__name__ print aa.__hash__ # other simliar
However, if above
aa() function is a template for write other code, say
bb(), I have to write:
def bb(): print bb.__name__ print bb.__hash__ # other simliar
Is there a "pointer" similar to the
self argument in a class method so I could write code like this?
def whatever(): print self.__name__ print self.__hash__ # other simliar
I searched and found someone said to use the class to solve this problem, but that may be a trouble to redefine all the existing functions. Any suggestions?