This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author pitrou
Recipients ezio.melotti, loewis, pitrou, rhettinger, serhiy.storchaka, vstinner, yaubi
Date 2014-07-30.01:42:29
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <53D84D7F.8010109@free.fr>
In-reply-to <1406682920.69.0.680732066949.issue22097@psf.upfronthosting.co.za>
Content
Le 29/07/2014 21:15, Raymond Hettinger a écrit :
>
> * One use case for the insert methods is trying to maintain a sort
order (such as an alphabetical order) but we don't have any efficient
search methods such as a binary search to find an insertion point. For
example, if I read an alphabetically sorted config file of key / value
pairs, how would I insert a new key/value pair in the proper position?

You'd certainly prefer a tree for that use case (O(log n) search and 
insertion rather than O(n) search and O(1) insertion).

I hadn't thought about the set operations. The use case here is really 
linked-list-alike, not set-alike.

I'm mildly relieved that, even though O(n), middle-of-list insertions 
are still plenty fast for reasonable sizes, which means Numba shouldn't 
suffer here (even though we do seem to have users generating Python code 
and then JIT-compiling it...).
History
Date User Action Args
2014-07-30 01:42:29pitrousetrecipients: + pitrou, loewis, rhettinger, vstinner, ezio.melotti, yaubi, serhiy.storchaka
2014-07-30 01:42:29pitroulinkissue22097 messages
2014-07-30 01:42:29pitroucreate