<div dir="ltr"><br><div class="gmail_extra"><div class="gmail_quote">On Tue, May 14, 2013 at 5:36 PM, Tim Delaney <span dir="ltr"><<a href="mailto:timothy.c.delaney@gmail.com" target="_blank">timothy.c.delaney@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div class="im">On 15 May 2013 09:34, Steven D'Aprano <span dir="ltr"><<a href="mailto:steve@pearwood.info" target="_blank">steve@pearwood.info</a>></span> wrote:<br>
</div><div class="gmail_extra"><div class="gmail_quote"><div class="im">
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div><br></div>I don't think that is a particularly good analogy. Stable sorting is<br>
intuitively correct. Treating keyword args differently according to<br>
their order is intuitively the wrong thing to do, at least most of the<br>
time.<br></blockquote><div><br></div></div><div>The argument *for* an ordered kwargs however is that same one that was used for Enums iterating in definition order by default - it's an ordering that can't be recovered once it's lost.</div>
<div><br></div><div>However, it's not a property that I think is absolutely necessary for kwargs and we shouldn't lose performance to gain that property, but there have been times when I would have liked it.</div>
</div></div></div></blockquote><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra">
<div class="gmail_quote"><div><br></div><div>Barry created a new dict implementation a while back that as a side-effect retained insertion order so long as no keys were removed. That would be suitable IMO for kwargs as a guarantee - definition order so long as nothing has been removed. It was discussed and there was the suggestion to actively break this functionality in order to prevent people relying on it. I'm not sure what the end result of the discussion was off the top of my head.</div>
</div></div></div></blockquote><div><br></div><div>There was also some conversation at the pycon sprints this year about if keyword arguments could use an ordered dict or not but I wasn't paying enough attention to that to be able to give a summary of what was discussed.</div>
<div><br></div><div>My gut feeling is that it'd add overhead even though I would find it useful at times.</div><div><br></div><div style>-gps</div></div></div></div>