<br><br><div class="gmail_quote">On Thu, Jan 20, 2011 at 8:42 AM, Guido van Rossum <span dir="ltr"><<a href="mailto:guido@python.org">guido@python.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">

<div class="im">On Thu, Jan 20, 2011 at 6:05 AM, M.-A. Lemburg <<a href="mailto:mal@egenix.com">mal@egenix.com</a>> wrote:<br><br>> "Nice to have" is not good enough to warrant a slow down of<br>
> all function calls involving keyword arguments, adding overhead<br>
> for other Python implementations and possibly causing problems<br>
> with 3rd party extensions relying on getting a PyDict for the<br>
> keyword arguments object.<br>
<br>
</div>What he says.<br>
<br>
In addition, I wonder what the semantics would be if the caller passed<br>
**d where d was an *unordered* dict...<br>
<font color="#888888"><br>
--<br>
--Guido van Rossum (<a href="http://python.org/~guido" target="_blank">python.org/~guido</a>)<br>
</font><div><div></div><div class="h5"><br>
</div></div></blockquote></div><br><div>Agree with both. And if we were to make this change, my next thought is that what I really want is an ordered multi-set, since in some scenarios where I want ordered parameters I also want repeated parameters. I don't think we should go there.</div>

<div><br></div><div>Back to the original problem though: if the issue is that creating an ordered dict is clumsy and perhaps interfering with adoption and usage then perhaps the notation for ordered dict could be improved. Just as we can now use {...} for both dicts and sets, perhaps we could add</div>

<div><br></div><blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;"><div>[ 'b' : 1, 'a' : 2 ]</div></blockquote><div>as a more convenient way of writing</div>

<blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;"><div>OrderedDict([('b', 1), ('a', 2)])</div></blockquote><div><br></div><div>This is parallel to the way that [1,2] is an ordered container while {1,2} is unordered.</div>

<div><br clear="all">--- Bruce<div>Latest blog post: <a href="http://www.vroospeak.com/2010/12/fix-filibuster.html" target="_blank">http://www.vroospeak.com/2010/12/fix-filibuster.html</a><br><div>Learn about security: <a href="http://j.mp/gruyere-security" target="_blank">http://j.mp/gruyere-security</a></div>

</div><br></div>