Am 28.01.2010 05:30, schrieb Steve Howell:

> If you want tools that are easy to use correctly, make them bug-free and
> document their behavior.  If you want tools that are easy to use well, then
> make them perform better.  I am not sure how my patch contradicts either of
> these goals.
> 
> You keep making the argument that deque is a better alternative to list in
> many situations.  I actually agree with you.  Most programming problems are
> best modelled by a queue.  I am not sure why Python lists get all the syntax
> sugar and promotion over deque, when in reality, Python lists implement a
> pretty useless data structure.  Python lists are a glorification of a C array
> built on top of a memory-upward-biased memory allocator.  As such, they
> optimize list appends (good) but fail awfully on list prepops (bad).  They
> are much better as stacks than queues, even though queues are more useful for
> the most common programming known to man--work through a work queue and
> delete tasks when they are done.
> 
> It is not surprising that Python lists are starting to show their lack of
> versatility in 2010.  They're based on 1970's technology.  Python lists are
> really just a thin encapsulation of C arrays built on top of an asymmetrical
> memory manager.
> 
> In 2010 you could improve Python lists by releasing from the constraints of
> 1970s semantics.  But I am starting to think a more modern approach would be
> to take more useful data structures like deques and give them more sugar.

This post made me laugh, and skip the rest of the thread.

Georg

-- 
Thus spake the Lord: Thou shalt indent with four spaces. No more, no less.
Four shall be the number of spaces thou shalt indent, and the number of thy
indenting shall be four. Eight shalt thou not indent, nor either indent thou
two, excepting that thou then proceed to four. Tabs are right out.

_______________________________________________
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