[issue28912] collections.abc.OrderedMapping

Raymond Hettinger report at bugs.python.org
Sat Dec 10 19:55:59 EST 2016


Raymond Hettinger added the comment:

Thank you for the link, it was nice to see Guido's reasons for giving a -0 on the proposal.  I would add that I haven't see any code in the wild that would benefit from testing isinstance(m, OrderedMapping) and taking some different action depending on the result.

Grant's sortedcollection is more sequence-like than mapping-like and the bidict has its own interesting properties and neither are substitutable for an OrderedDict.  In other words, the only properties these cluster on is the ordered equality feature.  IMO, that particular feature hasn't established itself as being valuable (we don't see much use of it with the existing ordered dicts, and likewise in the database world, table equivalence based on exact order rather than content equivalence is uncommon).

Given the limited utility, I am going to decline the proposal.  It is an interesting idea but I believe it that it would clutter the module, slightly drowning-out the ABCs that have more broad and established utility.

One other thought is that the proposed OrderedMapping ABC might not fit well in a possible future Python where the behavior Python 3.6 ordered-and-compact dicts becomes guaranteed but where we retain the traditional unordered equality comparison.

----------
resolution:  -> rejected
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue28912>
_______________________________________


More information about the Python-bugs-list mailing list