blist question

D

dmitrey

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) and
occasionally found blist
http://pypi.python.org/pypi/blist/
Its entry says it is better than Python list. Did anyone ensure?
Will it ever be merged into Python source code?
D.
 
R

Raymond Hettinger

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,159
Messages
2,570,886
Members
47,419
Latest member
ArturoBres

Latest Threads

Top