def getargspec(obj):
 if inspect.isfunction(obj):
  func_obj = obj
 elif inspect.ismethod(obj):
  func_obj = obj.__func__
 else:
  raise TypeError('arg is not a Python function')
 (args, varargs, varkw) = inspect.getargs(func_obj.__code__)
 return (args, varargs, varkw, func_obj.__defaults__)

def getargspec ( obj ) : if inspect . isfunction ( obj ) : func_obj = obj elif inspect . ismethod ( obj ) : func_obj = obj . __func__ else : raise TypeError ( 'arg is not a Python function' ) ( args , varargs , varkw ) = inspect . getargs ( func_obj . __code__ ) return ( args , varargs , varkw , func_obj . __defaults__ )
get the names and default values of a functions arguments .