On Fri, Sep 9, 2016 at 10:55 AM, Antoine Pitrou <solip...@pitrou.net> wrote: > On Thu, 8 Sep 2016 14:20:53 -0700 > Victor Stinner <victor.stin...@gmail.com> wrote: >> 2016-09-08 13:36 GMT-07:00 Guido van Rossum <gu...@python.org>: >> > IIUC there's one small thing we might still want to change somewhere >> > after 3.6b1 but before 3.6rc1: the order is not preserved when you >> > delete some keys and then add some other keys. Apparently PyPy has >> > come up with a clever solution for this, and we should probably adopt >> > it, but it's probably best not to hurry that for 3.6b1. >> >> Very good news: I was wrong, Raymond Hettinger confirmed that the >> Python 3.6 dict *already* preserves the items order in all cases. In >> short, Python 3.6 dict = Python 3.5 OrderedDict (in fact, OrderedDict >> has a few more methods). > > Is it an official feature of the language or an implementation detail? > > Regards > > Antoine.
I think an implementation detail (although I'm not opposed to having it mentioned in the spec), but using the same/similar approach for sets should be mostly relatively simple, no? PyPy has a pure python OrderedDict which is a wrapper around dict. For 3.6 it needs an adjustement since new methods showed up _______________________________________________ Python-Dev mailing list Python-Dev@python.org https://mail.python.org/mailman/listinfo/python-dev Unsubscribe: https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com