Andrés Delfino <adelf...@gmail.com> added the comment:

The problem here is that while the historical issue is real, new programmers 
will come and they won't see a "non-ordered" dict, and having this 
"dictionaries" vs "ordered dictionaries" that aren't actual OrderedDict objects 
(which have the common name "ordered dictionaries", though), will be really 
confusing for them.

A dictionary (treated as a synonym for dict) can't have an order different than 
insertion order, because that is one of the guarantees a *dictionary* provides. 
If one needs to have an object with another sort of ordering, then we talk 
about a dict-like object, or a dict subclass; but IMHO "dictionary" alone 
should imply not only a very specific order, but a very specific type too: 
dict. A dict subclass with different ordering is nothing but that, not a 
dictionary with different ordering, that would imply one can setup the ordering 
method of a dict class.

Plus, ordered dictionaries (OrderedDict objects) don't provide exactly the same 
API as dictionaries, so it gets tricky to use that term to also include 
dictionaries. It's quite reasonable to expect "ordered dictionaries" to be 
confused with "OrderedDict objects".

Also, I feel somewhat uncomfortable about "most likely". It's fine to use weak 
names (dict-like, subclass of dict, mapping, etc.), but not knowing exactly 
what you can *rely on* (i.e. a required subset of whatever the implementation 
actually provides) from a given API is quite confusing. Notice that it doesn't 
have to be an actual type, but at least some sort of description of what is 
guaranteed (i.e. a mapping).

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue33863>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to