--- On Wed, 1/27/10, Glenn Linderman <v+pyt...@g.nevcal.com> wrote:
> As a newcomer to python, I must say that I wouldn't expect
> a list to be like an array.  I'd expect it more to be
> like a list... many implementations of lists (linked lists,
> in particular) make it O(1) to add to the front or
> back.  An array can be used to represent a list, but
> there are known inefficiencies that result when doing so,
> one of which the Subject patch is working to address. 
> I guess I would have expected something called an array to
> be more like an array, rather than something called a
> list.  But one has to read the documentation to find
> out what things really mean, in a new environment.
> 

My concept of Python lists is that they should have at least the same 
performance characteristics as an ordinary to-do list that you make with 
pencil, paper, and an eraser.

When you complete the first task on your to-do list, you can just erase it; no 
need to recopy the whole list.   When you complete all the elements on the 
first page, throw away the paper.  As you find new tasks to complete, add them 
on the end.  When you fill up a page, get a new sheet of paper.

If you complete the first task, erase it, but then a new urgent task comes in, 
go ahead and write the new urgent task on the first line of the first page.

If, for some reason, you keep getting bombarded with tasks that are more urgent 
than the plan you originally set out for yourself, you need a more powerful 
tool than a simple pencil/paper tool list, and by analogy, you would need a 
more powerful tool than a Python list to do it electronically.

But if you are just working your way through a paper to-do list, then erasing 
elements from the top works in O(1) time with occasional compacting of paper 
when you finish a whole page of tasks.

In my mind Python's lists should have the same performance characteristics as 
the paper list (or better).


_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to