class classA(): def defA(self): function_name = sys._getframe().f_code.co_name class_name = self.__class__.__name__ print(class_name,function_name)
classA defA