<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Thu, Jun 16, 2016 at 3:24 PM, Nikita Nemkin <span dir="ltr"><<a href="mailto:nikita@nemkin.ru" target="_blank">nikita@nemkin.ru</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On Fri, Jun 17, 2016 at 2:36 AM, Nick Coghlan <<a href="mailto:ncoghlan@gmail.com">ncoghlan@gmail.com</a>> wrote:<br>
> On 16 June 2016 at 14:17, Martin Teichmann <<a href="mailto:lkb.teichmann@gmail.com">lkb.teichmann@gmail.com</a>> wrote:<br>
<br>
</span><span class="">> An implementation like PyPy, with an inherently ordered standard dict<br>
> implementation, can just rely on that rather than being obliged to<br>
> switch to their full collections.OrderedDict type.<br>
<br>
</span>I didin't know that PyPy has actually implemented packed ordered dicts!<br>
<a href="https://morepypy.blogspot.ru/2015/01/faster-more-memory-efficient-and-more.html" rel="noreferrer" target="_blank">https://morepypy.blogspot.ru/2015/01/faster-more-memory-efficient-and-more.html</a><br>
<a href="https://mail.python.org/pipermail/python-dev/2012-December/123028.html" rel="noreferrer" target="_blank">https://mail.python.org/pipermail/python-dev/2012-December/123028.html</a><br>
<br>
This old idea by Raymond Hettinger is vastly superior to __definition_order__ duct tape (now that PyPy has validated it).<br>
It also gives kwarg order for free, which is important in many metaprogramming scenarios.<br>
Not to mention memory usage reduction and dict operations speedup...<br></blockquote><div><br></div><div>That idea is only vastly superior if we want to force all other Python implementations to also have an order-preserving dict with the same semantics and API.<br><br></div><div>I'd like to hear more about your metaprogramming scenarios -- often such things end up being code the author is ashamed of. Perhaps they should stay in the shadows? Or could we do something to make it so you won't have to be ashamed of it?<br></div></div><br>-- <br><div class="gmail_signature" data-smartmail="gmail_signature">--Guido van Rossum (<a href="http://python.org/~guido" target="_blank">python.org/~guido</a>)</div>
</div></div>