Getting method arguments into a list of key and value pairs
<p>I'm looking to get each of my method parameters into a dictionary or tuple pairs in a list as later the arguments get put through <code>urllib.urlencode</code> and formed into a POST statement.</p>

<p>I got as far as this from other SO questions</p>

<pre><code>def func(a,b,c,d,e=None,f=None):
  values= locals()
  data= dict((k,v) for k,v in values.iteritems() if v is not None)
</code></pre>

<p>This second line just strips out the optional arguments not used. The problem with this is because I'm using this as POST data later I need the order of the arguments to be maintained.</p>

<p>So is there a similar way of doing the above but I guess avoiding the use of dictionaries because they are orderless?</p>

<p>EDIT: I might have just overlooked something completely.. I can send values through POST in any order right?  </p>
