def get_real_func(obj):
 while hasattr(obj, '__wrapped__'):
  obj = obj.__wrapped__
 if isinstance(obj, functools.partial):
  obj = obj.func
 return obj

def get_real_func ( obj ) : while hasattr ( obj , '__wrapped__' ) : obj = obj . __wrapped__ if isinstance ( obj , functools . partial ) : obj = obj . func return obj
gets the real function object of the wrapped object by functools .