title: Is it possible to remove an item from argument list?
body: <pre><code>def foo(name, *args, **kwargs):
  </code></pre>
  
  <p>I need to remove the first two arguments of <code>*args</code> in case its length (<code>len(args)</code>) is greater than two. Is it possible to do that?</p>
  
  <p>Here is why I need to do that:
  I've got the following function:</p>
  
  <pre><code>def foo(name, xml='my.xml', xsd='my.xsd', *otherfiles):
      print('name: ' + name)
      print('xml: ' + xml)
      print('xsd: ' + xsd)
      print(otherfiles)
  </code></pre>
  
  <p>I need to add an optional boolean parameter to the arguments of this function, without breaking the backward compatibility. So I change the function to this:</p>
  
  <pre><code>def foo2(name, *otherfiles, **kwargs):
      kwargs.setdefault('relativePath', True)
      if len(otherfiles)&gt;0:
          xml = otherfiles[0]
      else:
          kwargs.setdefault('xml', 'my.xml')
          xml = kwargs['xml']
  
      if len(otherfiles)&gt;1:
          xsd = otherfiles[1]
      else:
          kwargs.setdefault('xsd', 'my.xsd')
          xsd = kwargs['xsd']
      print('name: ' + name)
      print('xml: ' + xml)
      print('xsd: ' + xsd)
      print(otherfiles)
  </code></pre>
  
  <p>Now I test the backward compatibility by checking if the output of <code>foo</code> and <code>foo2</code> is the same:</p>
  
  <pre><code>foo('my_name', '../my.xml', '../my.xsd', 'file1', 'file2')
  print('===============================================================')
  foo2('my_name', '../my.xml', '../my.xsd', 'file1', 'file2')
  </code></pre>
  
  <p>The output:</p>
  
  <pre><code>name: my_name  
  xml: ../my.xml  
  xsd: ../my.xsd  
  ('file1', 'file2')  
  ===============================================================  
  name: my_name  
  xml: ../my.xml  
  xsd: ../my.xsd  
  ('../my.xml', '../my.xsd', 'file1', 'file2')
  </code></pre>
  
  <p>As you can see, the first two items of <code>otherfiles</code> should be removed to maintain the old functionality.</p>