On Thu, Jan 28, 2010 at 9:48 PM, Terry Reedy <tjre...@udel.edu> wrote: > On 1/28/2010 6:30 PM, Josiah Carlson wrote: > >> I would also point out that the way these things are typically done is >> that programmers/engineers have use-cases that are not satisfied by >> existing structures, they explain the issues they have with existing >> structures, and they propose modifications. So far, Steve has not >> offered any use-cases for why his proposed change is necessary; merely > > Use of a list as a queue rather than as a stack, as in breadth-first search, > where one only needs to pop off the front but never push to the front. That > is not to say that this is common or that a deque or other options may no be > pretty satisfactory. But it would certainly be easier, when presenting such > algorithms, to just be able to use a list, which has already been taught, > than to introduce another structure. Currently a deque is not a drop-in > replacement for a list in that one cannot use all list methods with a deque.
Being able to use a list and get good performance straight off would be *convenient*. But that's it. People use it as a queue, discover that it is slow, ask (or research), and discover the deque. The use-cases where having the full range of list methods *and* deque behavior are fairly slim (perhaps none in my experience), and I argue are better covered by structures that are neither a Python list (even with the modifications offered by Steve) nor a deque. - Josiah _______________________________________________ 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