def get_arg_spec(func, debug=True):
 (allargs, varargs, keywords, defaults) = inspect.getargspec(func)
 if ('self' in allargs):
  allargs.remove('self')
 nargs = len(allargs)
 ndefaults = 0
 if defaults:
  ndefaults = len(defaults)
 nrequired = (nargs - ndefaults)
 args = allargs[:nrequired]
 kwargs = allargs[nrequired:]
 if debug:
  log.debug(('nargs = %s' % nargs))
  log.debug(('ndefaults = %s' % ndefaults))
  log.debug(('nrequired = %s' % nrequired))
  log.debug(('args = %s' % args))
  log.debug(('kwargs = %s' % kwargs))
  log.debug(('defaults = %s' % str(defaults)))
 return (args, kwargs)

def get_arg_spec ( func , debug = True ) : ( allargs , varargs , keywords , defaults ) = inspect . getargspec ( func ) if ( 'self' in allargs ) : allargs . remove ( 'self' ) nargs = len ( allargs ) ndefaults = 0 if defaults : ndefaults = len ( defaults ) nrequired = ( nargs - ndefaults ) args = allargs [ : nrequired ] kwargs = allargs [ nrequired : ] if debug : log . debug ( ( 'nargs = %s' % nargs ) ) log . debug ( ( 'ndefaults = %s' % ndefaults ) ) log . debug ( ( 'nrequired = %s' % nrequired ) ) log . debug ( ( 'args = %s' % args ) ) log . debug ( ( 'kwargs = %s' % kwargs ) ) log . debug ( ( 'defaults = %s' % str ( defaults ) ) ) return ( args , kwargs )
convenience wrapper around inspect .