title: How to print the list of args and kwargs
body: <p>In my code, I have many places where I pass a function and its arguments to another function. For debugging purposes, I want to print the name of the function and the list of arguments. For example </p>
  
  <pre><code>def process(f, *args, **kwargs):
      print("processing " + print_func(f, args, kwargs))
  </code></pre>
  
  <p>The expected output for 
      <code>process(myfunc, 1,2, a="A",b=0)</code> should be <code>"processing myfunc(1,2,a="A", b=0)"</code> </p>
  
  <p>I made some progress printing the <code>args</code> as follows:</p>
  
  <pre><code>def print_func(f, *args, **kwarg):
      func_str = f.__name__ + "("
      if len(args) &gt; 0:
          func_str = func_str + (', '.join(['%.2f']*len(x)) % args)
       func_str = func_str + ")"
  </code></pre>
  
  <p>which in the example above will produce the output <code>processing myfunc(1,2)</code></p>
  
  <p>The problem I have is how to print the kwargs. I can't figure out a similar solution using a dynamic formatting string for printing it as a sequence of <code>k=v</code> pairs separated by ",".</p>
  
  <p>Any suggestion would be appreciated.  </p>