4 ms·
> Dictionaries with guaranteed ordering. I don't think you're suppose to depend on the ordering of dictionaries. It's an implementation detail which might get
by Buttons840 10y ago
> Dictionaries with guaranteed ordering.
I don't think you're suppose to depend on the ordering of dictionaries. It's an implementation detail which might get changed, although it wont actually ever be changed because people will come to depend on it.
- thecardcheat 10y ago> I don't think you're suppose to depend on the ordering of dictionaries. It's an implementation detail which might get changed, although it wont actually ever be changed because people will come to depend on it. I came here to make the same distinction - though I will say I hope you are wrong about people coming to depend on it when OrdereredDict is still there for a reason. The docs still plainly state that Dict should be considered un-ordered and do not make mention of this implementation detail (nor should they).
- bmh100 10y agoI'm specifically referring to OrderedDict in this case, which does have guaranteed, insertion-based ordering. It was introduced in 3.1, circa 2009, via PEP 372.
- wolf550e 10y agohttps://docs.python.org/2/library/collections.html#ordereddict-objects https://docs.python.org/2/library/collections.html#ordereddi... > New in version 2.7.
- bmh100 10y agoThat's a good point. I didn't realize that it was also introduced into 2.7 at the same time.
- deleted 10y ago[deleted]