<div dir="ltr"><div class="gmail_extra"><br><div class="gmail_quote">On Sun, May 19, 2013 at 1:47 AM, Guido van Rossum <span dir="ltr"><<a href="mailto:guido@python.org" target="_blank">guido@python.org</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 id=":13k" style="overflow:hidden">I'm slow at warming up to the idea. My main concern is speed -- since<br>

most code doesn't need it and function calls are already slow (and<br>
obviously very common :-) it would be a shame if this slowed down<br>
function calls that don't need it noticeably.</div></blockquote></div><br>Here is an idea that will not affect functions that don't need to know the order of keywords: a special __kworder__ local variable.  The use of this variable inside the function will signal compiler to generate additional bytecode to copy keyword names from the stack to a tuple and save it in __kworder__.    With that feature, an OrderedDict constructor, for example can be written as</div>
<div class="gmail_extra"><br></div><div class="gmail_extra" style>def odict(**kwargs):</div><div class="gmail_extra" style>      return OrderedDict([(key, kwargs[key]) for key in __kworder__])</div><div class="gmail_extra" style>
<br></div><div class="gmail_extra" style> </div></div>