Since when builtin dict preserve key order?

Chris Angelico rosuav at gmail.com
Sat Mar 24 07:53:04 EDT 2018


On Sat, Mar 24, 2018 at 10:48 PM, Marko Rauhamaa <marko at pacujo.net> wrote:
> Chris Angelico <rosuav at gmail.com>:
>
>> On Sat, Mar 24, 2018 at 7:48 PM, Marko Rauhamaa <marko at pacujo.net> wrote:
>>> Is that part of the Python Language Specification? If not, it
>>> shouldn't be exploited in application programs.
>>
>> Yes, it is; but the language spec wasn't locked in quite as soon as
>> the functionality was. So you may find that CPython 3.6 preserves
>> order more than the language requires. Starting with 3.7 (I believe),
>> the language spec is significantly tighter.
>
> I take it, then, that the Language Specification follows CPython's
> version numbering. I wonder how other Python implementations declare
> their standards compliance.
>

Have you thought to look?

$ pypy
Python 2.7.12 (5.6.0+dfsg-4, Nov 20 2016, 10:43:30)
[PyPy 5.6.0 with GCC 6.2.0 20161109] on linux2

Tada.

ChrisA



More information about the Python-list mailing list