blist question

Raymond Hettinger python at rcn.com
Fri Jul 8 00:46:16 CEST 2011


On Jul 7, 5:08 am, dmitrey <dmitre... at gmail.com> wrote:
> hi all,
> I feel lack of native Python lists operations (e.g. taking N greatest
> elements with the involved key function and O(n) speed)

Take a look at heapq.nlargest()...


> and
> occasionally found blisthttp://pypi.python.org/pypi/blist/
> Its entry says it is better than Python list.

It should say:  better in some respects and worse in others

Do you honestly think that python's list implementation
as a simple array of pointers can be beaten in every
category of performance?


> Did anyone ensure?
> Will it ever be merged into Python source code?

It was rejected as a replacement for the existing list implementation.
There is some chance it will get accepted into the collections module
someday.


Raymond



More information about the Python-list mailing list