def get_func_args(func):
 if inspect.isfunction(func):
  (func_args, _, _, _) = inspect.getargspec(func)
 elif hasattr(func, '__call__'):
  try:
   (func_args, _, _, _) = inspect.getargspec(func.__call__)
  except Exception:
   func_args = []
 else:
  raise TypeError(('%s is not callable' % type(func)))
 return func_args

def get_func_args ( func ) : if inspect . isfunction ( func ) : ( func_args , _ , _ , _ ) = inspect . getargspec ( func ) elif hasattr ( func , '__call__' ) : try : ( func_args , _ , _ , _ ) = inspect . getargspec ( func . __call__ ) except Exception : func_args = [ ] else : raise TypeError ( ( '%s is not callable' % type ( func ) ) ) return func_args
return the argument name list of a callable .