title: Python trying to place keyword arguments after *args
body: <p>I'm a bit confused about using <code>*args</code>.</p>
  
  <p>I want to write a function that takes a variable number of arguments but can still use the advantage of defining a predefined value for a keyword argument.</p>
  
  <p>But it's not possible to write a function like this:</p>
  
  <pre><code>def foo(*args, bar = "foo"):
      print bar, args
  </code></pre>
  
  <p>It's just possible to write it like this:</p>
  
  <pre><code>def foo2(bar = "foo", *args):
      print bar, args
  </code></pre>
  
  <p>But then I call <code>foo2</code> and pass the first argument it overrides the default value for <code>bar</code>!.</p>
  
  <pre><code>foo2("somevalue")
  somevalue ()
  </code></pre>
  
  <p>Is where a way of doing this better ??</p>
  
  <p>I know I could write it like this:</p>
  
  <pre><code>def foo(*args, **kwargs):
      kwargs["bar"] = "foo"
  </code></pre>
  
  <p>but something like the first method definition (which yields a syntax error) is more intuitive from my point of view.</p>