<br><br><div class="gmail_quote">On Thu, Jan 20, 2011 at 1:21 AM, Arnaud Delobelle <span dir="ltr"><<a href="mailto:arnodel@gmail.com">arnodel@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div><div></div><div class="h5">On 20 January 2011 04:29, Don Spaulding <<a href="mailto:donspauldingii@gmail.com">donspauldingii@gmail.com</a>> wrote:<br>
> Hi there python-ideas!<br>
> Does it bother anyone else that it's so cumbersome to instantiate an<br>
> OrderedDict with ordered data?<br>
> >>> from collections import OrderedDict<br>
> >>> OrderedDict(b=1,a=2)<br>
> OrderedDict([('a', 2), ('b', 1)]) # Order lost. Boooo.<br>
> >>> OrderedDict([('b',1),('a',2)])<br>
> OrderedDict([('b', 1), ('a', 2)])<br>
> Obviously, OrderedDict's __init__ method (like all other functions) never<br>
> gets a chance to see the kwargs dict in the order it was specified. It's<br>
> usually faked by accepting the sequence of (key, val) tuples, as above. I<br>
> personally think it would be nice to be able to ask the interpreter to keep<br>
> track of the order of the arguments to my function, something like:<br>
> def sweet_function_name(*args, **kwargs, ***an_odict_of_kwargs):<br>
> pass<br>
> I'm not married to the syntax. What do you think about the idea?<br>
<br>
</div></div>FYI this was discussed before on this list at least once:<br>
<br>
<a href="http://mail.python.org/pipermail/python-ideas/2009-April/004163.html" target="_blank">http://mail.python.org/pipermail/python-ideas/2009-April/004163.html</a><br>
<br>
--<br>
<font color="#888888">Arnaud<br></font></blockquote><div><br></div><div>So it was. Thanks for that link. Am I to assume nothing ever came of that discussion?</div></div><br>