[Python-ideas] OrderedDict for kwargs and class statement namespace

Antoine Pitrou solipsis at pitrou.net
Fri Mar 1 10:31:10 CET 2013


Le Thu, 28 Feb 2013 16:41:28 -0700,
Eric Snow <ericsnowcurrently at gmail.com> 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 :-)

Regards

Antoine.





More information about the Python-ideas mailing list