<div dir="ltr"><br><br><div class="gmail_quote"><div dir="ltr">On Fri, 9 Sep 2016 at 01:58 Antoine Pitrou <<a href="mailto:solipsis@pitrou.net">solipsis@pitrou.net</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On Thu, 8 Sep 2016 14:20:53 -0700<br>
Victor Stinner <<a href="mailto:victor.stinner@gmail.com" target="_blank">victor.stinner@gmail.com</a>> wrote:<br>
> 2016-09-08 13:36 GMT-07:00 Guido van Rossum <<a href="mailto:guido@python.org" target="_blank">guido@python.org</a>>:<br>
> > IIUC there's one small thing we might still want to change somewhere<br>
> > after 3.6b1 but before 3.6rc1: the order is not preserved when you<br>
> > delete some keys and then add some other keys. Apparently PyPy has<br>
> > come up with a clever solution for this, and we should probably adopt<br>
> > it, but it's probably best not to hurry that for 3.6b1.<br>
><br>
> Very good news: I was wrong, Raymond Hettinger confirmed that the<br>
> Python 3.6 dict *already* preserves the items order in all cases. In<br>
> short, Python 3.6 dict = Python 3.5 OrderedDict (in fact, OrderedDict<br>
> has a few more methods).<br>
<br>
Is it an official feature of the language or an implementation detail?<br></blockquote><div><br></div><div>It depends on the context. **kwargs is now defined to be an ordered mapping and PEP 520 has been updated to drop __definition_order__ and to say that cls.__dict__ is an ordered mapping. Otherwise we have not made dict itself ordered everywhere.</div><div><br></div><div>And there has been discussion to rip out the C code for OrderedDict and change the Python code to subclass dict so it only has to provide its additions to the dict API.</div></div></div>