Using variable length argument lists and named parameters together
<p>I need some help with figuring out Pythons <code>*args</code> and <code>**kwargs</code>. It's simple but I haven't entire wrapped my head around them. Here's one of scenarios that's bewildering to me.</p>

<p>I have two functions <code>mainfunc</code> and <code>wrapperfunc</code> (which is a wrapper function for the main function). It looks like this.</p>

<pre><code>def mainfunc(fname=None, lname=None):
    print 'Firstname: ' + fname
    print 'Lastname: ' + lname

def wrapperfunc(uname, *args):
    print uname
    mainfunc(*args)
</code></pre>

<p>I can call <code>wrapperfunc</code> like this:</p>

<pre><code>wrapperfunc('j.doe', 'john', 'doe')
</code></pre>

<p>In this method, all three parameters are positional. Since <code>j.doe</code> comes into <code>uname</code>, the other two params can be accessed by <code>*args</code></p>

<p>..but is it possible to pass some of the params to <code>wrapperfunc</code> from a dict so that I can still access <code>uname</code> inside <code>wrapperfunc</code> directly and then pass the remaining positional parameters to the <code>mainfunc</code>. Something like the following snippet:</p>

<pre><code>params = {'uname':'j.doe'}
wrapperfunc(**params, 'john', 'doe')
</code></pre>

<p>I want to access the named parameters directly inside <code>wrapperfunc</code> but pass all the positional parameters to <code>mainfunc</code>.</p>
