2 ms·
A section called "CPython implementation detail" looks like the very antithesis of a guarantee, to me.
by StavrosK 9y ago
A section called "CPython implementation detail" looks like the very antithesis of a guarantee, to me.
- eesmith 9y agoMy apologies. I looked for the answer I knew was there, and quoted the wrong section because it matched what I was looking for. I should have quoted the next section: > If items(), keys(), values(), iteritems(), iterkeys(), and itervalues() are called with no intervening modifications to the dictionary, the lists will directly correspond. Curiously, the "Dictionary view objects" section at https://docs.python.org/2.7/library/stdtypes.html#dictionary-view-objects https://docs.python.org/2.7/library/stdtypes.html#dictionary... has the same "Keys and values are iterated over in an arbitrary order which is non-random ..." text, but without being inside of a "CPython implementation detail" box.
- StavrosK 9y agoHuh, that's inconsistent. I guess they changed it to avoid the security problem and forgot to change the docs? Or maybe they didn't update 2.7 at all and it still behaves that way.