[Python-ideas] `OrderedDict.sort`

Andrew Barnert abarnert at yahoo.com
Wed Sep 25 21:29:51 CEST 2013

On Sep 25, 2013, at 9:53, Ethan Furman <ethan at stoneleaf.us> wrote:

> On 09/25/2013 08:59 AM, Andrew Barnert wrote:
>> On Sep 24, 2013, at 21:27, "Stephen J. Turnbull" <stephen at xemacs.org> wrote:
>>> I'll grant that some users might be perfectly happy with O(log N)
>>> "reasonably fast" access, but others would not be pleased.
>> O(log N) is fast enough for the standard mappings in C++, Java, etc., are python users more demanding of performance than C++?
> I admit I know next to nothing about C++ and Java, but in Python the dict is ubiquitous: modules have them, classes have them, nearly every user defined instance has them, they're passed into functions, they're used for dispatch tables, etc., etc..
> So I suspect that Python is more demanding of its mapping than the others are.

Nobody is suggesting replacing dict with a tree-based mapping, just adding one in the collections module for the use cases where it's what you want.

More information about the Python-ideas mailing list