Le Thu, 28 Feb 2013 16:41:28 -0700, Eric Snow firstname.lastname@example.org a écrit :
With OrderedDict, I have no illusions of getting everything done quickly, but do feel that the the bulk of the coding is wrapping up. I suppose that in more experienced hands it would be done quickly, but I'm not asking for that. Rather, I want to get a sense of the applicability of OrderedDict to Python's internals since it would be available as a built-in type. I've presented what I consider as two useful internal applications but would certainly like to know what you think.
Well, the OrderedDict constructor is quite a strong use case, as you pointed out (and the only one I can think of :-)).
Still, in an aesthetical sense, I like the idea of the Python dict being a pure unordered hash table. Ordered dicts are good for some use cases (I do use them too), but it sounds a bit wrong to make them the first-class mapping type; perhaps because it would feel like PHP :-)