list.pop(0) vs. collections.dequeue

Daniel Stutzbach daniel at
Sat Jan 23 01:05:36 CET 2010

On Fri, Jan 22, 2010 at 5:27 PM, Steve Howell <showell30 at> wrote:

> I actually do expect Python to solve performance problems for me that
> are more easily solved in core than in Python itself.  So I guess
> that's where we differ.

You might be interested in the extension type I wrote (the "blist") that
looks, acts, and quacks like a list, but takes worst-case O(log n) time for
inserting and removing elements anywhere in the list.

It's available for download here:

And there's a detailed performance comparison with the built-in list here:

Daniel Stutzbach, Ph.D.
President, Stutzbach Enterprises, LLC <>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the Python-list mailing list