O(n^2) is bad - can it be fixed?

Courageous jkraska1 at san.rr.com
Sat May 26 05:06:59 EDT 2001


>It's a design question, and Guido picked a particular answer 10 years ago;
>in practice it works fine.  There would be much more sympathy for a list
>implementation that was friendlier to insert and remove at both ends,

I have this implementation at http://www.sourceforge/projects/pythonic.
In cvs, checkout adt. You want the "dlist" (double ended list) type. It's
a vector which uses prealloc at the head AND the tail. This implements
much of the basic python list's capability, albeit it's never been intended
as a patch replacement for listobject.c.

>Says who?  I feel no need for this.  If you think it's a need, write an
>extension module implementing it and then sell that on real-life merit.  If
>people find it gives them a real advantage, they'll agitate to move it into
>the core.

mylist = []1000

This would be a cool construct.

C..




More information about the Python-list mailing list