pass **kwargs argument to another function with **kwargs
<p>I do not understand the following example, lets say I have these functions:</p>

<pre><code># python likes
def save(filename, data, **kwargs):
    fo = openX(filename, "w", **kwargs) # &lt;- #1
    fo.write(data)
    fo.close()
# python doesnt like
def save2(filename, data, **kwargs):
    fo = openX(filename, "w", 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 doesnt like the second one and tells me I gave to 3 instead of 2 arguments.
So whats the reason behind this?</p>
