def make_signature(func):
 spec = signature(func)
 if (spec.defaults is None):
  n_wo_defaults = len(spec.args)
  defaults = (('',) * n_wo_defaults)
 else:
  n_wo_defaults = (len(spec.args) - len(spec.defaults))
  defaults = ((('',) * n_wo_defaults) + spec.defaults)
 args = []
 for (i, (var, default)) in enumerate(zip(spec.args, defaults)):
  args.append((var if (default == '') else ((var + '=') + repr(default))))
 if spec.varargs:
  args.append(('*' + spec.varargs))
 if spec.keywords:
  args.append(('**' + spec.keywords))
 return (args, spec.args)

def make_signature ( func ) : spec = signature ( func ) if ( spec . defaults is None ) : n_wo_defaults = len ( spec . args ) defaults = ( ( '' , ) * n_wo_defaults ) else : n_wo_defaults = ( len ( spec . args ) - len ( spec . defaults ) ) defaults = ( ( ( '' , ) * n_wo_defaults ) + spec . defaults ) args = [ ] for ( i , ( var , default ) ) in enumerate ( zip ( spec . args , defaults ) ) : args . append ( ( var if ( default == '' ) else ( ( var + '=' ) + repr ( default ) ) ) ) if spec . varargs : args . append ( ( '*' + spec . varargs ) ) if spec . keywords : args . append ( ( '**' + spec . keywords ) ) return ( args , spec . args )
returns a string repr of the arg list of a func call .