title: pass **kwargs argument to another function with **kwargs
body: <p>I do not understand the following example, let's say I have these functions:</p>
  <pre><code># python likes
  def save(filename, data, **kwargs):
      fo = openX(filename, &quot;w&quot;, **kwargs) # &lt;- #1
      fo.write(data)
      fo.close()
  # python doesnt like
  def save2(filename, data, **kwargs):
      fo = openX(filename, &quot;w&quot;, kwargs) # &lt;- #2
      fo.write(data)
      fo.close()
  
  def openX(filename, mode, **kwargs):
      #doing something fancy and returning a file object
  </code></pre>
  <p>Why is #1 the right solution and #2 the wrong one? <code>**kwargs</code> is basically a dict, so if I want to pass down the argument to openX I think the correct way would be without <code>**</code> and just giving the dict. But Python obviously doesn't like the second one and tells me I gave 3 instead of 2 arguments.</p>
  <p>So what's the reason behind this?</p>