def makeListCompatible(fn):
 def newfn(*args):
  'Generated function. Closure-ish.'
  if (len(args) == 1):
   return fn(*args)
  args = ' '.join(map(str, args))
  return fn(args)
 setattr(newfn, '__name__', fn.__name__)
 setattr(newfn, '__doc__', fn.__doc__)
 return newfn

def makeListCompatible ( fn ) : def newfn ( * args ) : if ( len ( args ) == 1 ) : return fn ( * args ) args = ' ' . join ( map ( str , args ) ) return fn ( args ) setattr ( newfn , '__name__' , fn . __name__ ) setattr ( newfn , '__doc__' , fn . __doc__ ) return newfn
return a new function allowing fn to be called as newfn .