title: Getting the keyword arguments actually passed to a Python method
body: <p>I'm dreaming of a Python method with explicit keyword args:</p>
  
  <pre><code>def func(a=None, b=None, c=None):
      for arg, val in magic_arg_dict.items():   # Where do I get the magic?
          print '%s: %s' % (arg, val)
  </code></pre>
  
  <p>I want to get a dictionary of only those arguments the caller actually passed into the method, just like <code>**kwargs</code>, but I don't want the caller to be able to pass any old random args, unlike <code>**kwargs</code>.</p>
  
  <pre><code>&gt;&gt;&gt; func(b=2)
  b: 2
  &gt;&gt;&gt; func(a=3, c=5)
  a: 3
  c: 5
  </code></pre>
  
  <p>So: is there such an incantation?  In my case, I happen to be able to compare each argument against its default to find the ones that are different, but this is kind of inelegant and gets tedious when you have nine arguments.  For bonus points, provide an incantation that can tell me even when the caller passes in a keyword argument assigned its default value:</p>
  
  <pre><code>&gt;&gt;&gt; func(a=None)
  a: None
  </code></pre>
  
  <p>Tricksy!</p>
  
  <p><b>Edit:</b> The (lexical) function signature has to remain intact.  It's part of a public API, and the primary worth of the explicit keyword args lies in their documentary value.  Just to make things interesting. :)</p>