Re: [Python-Dev] deque alternative (was: Linked lists)

2005-12-26 Thread Christian Tismer
Hi all, not addressing anybody directly here, but this thread is about my dequeue question. It would just be nice if you could use the original thread topic or a different one to discuss the original question. -- Christian Tismer :^) tismerysoft GmbH

Re: [Python-Dev] deque alternative (was: Linked lists)

2005-12-26 Thread Phillip J. Eby
At 11:04 AM 12/26/2005 -0800, Josiah Carlson wrote: >Not necessarily so as I have pointed out above. You said yourself; >practicality beats purity. While using cons cells are pure, as us using >only flat lists are pure, flat lists are practically smaller than cons >cells in certain cases (by a fa

Re: [Python-Dev] deque alternative (was: Linked lists)

2005-12-26 Thread Tim Peters
... [Tim Peters] >> I'm sure he did ;-) Consider a very simple graph, a skinny tree >> rooted at `A` that branches once "at the end", represented by a dict >> of adjacency lists: [Josiah Carlson] > Are you sure? Of what? > ... > But one doesn't _need_ to use flat lists. Of course not. You d

Re: [Python-Dev] deque alternative (was: Linked lists)

2005-12-26 Thread Josiah Carlson
> [restoring context and attributions lost in the original] > > [Tim Peters] > Like Phillip Eby, I use 2-tuples for this when I feel the need > (usually during a backtracking graph search, to keep track of paths > back to the root in a space-efficient way), and am happy with that.

Re: [Python-Dev] deque alternative (was: Linked lists)

2005-12-26 Thread Tim Peters
[restoring context and attributions lost in the original] [Tim Peters] Like Phillip Eby, I use 2-tuples for this when I feel the need (usually during a backtracking graph search, to keep track of paths back to the root in a space-efficient way), and am happy with that. [Josiah Carl

Re: [Python-Dev] deque alternative (was: Linked lists)

2005-12-26 Thread James Y Knight
On Dec 26, 2005, at 11:07 AM, Martin Blais wrote: >> Then there's the whole Python list with append() and pop(). It >> takes a >> method resolution and function call, but at least in Python 2.3, >> it is a >> hair faster... > > Josiah, that's beside the point, because it is not space-efficien

Re: [Python-Dev] deque alternative (was: Linked lists)

2005-12-26 Thread Martin Blais
On 12/25/05, Josiah Carlson <[EMAIL PROTECTED]> wrote: > > Tim Peters <[EMAIL PROTECTED]> wrote: > > Like Phillip Eby, I use 2-tuples for this when I feel the need > > (usually during a backtracking graph search, to keep track of paths > > back to the root in a space-efficient way), and am happy wi

Re: [Python-Dev] deque alternative (was: Linked lists)

2005-12-25 Thread Josiah Carlson
Tim Peters <[EMAIL PROTECTED]> wrote: > Like Phillip Eby, I use 2-tuples for this when I feel the need > (usually during a backtracking graph search, to keep track of paths > back to the root in a space-efficient way), and am happy with that. Then there's the whole Python list with append() and p

Re: [Python-Dev] deque alternative (was: Linked lists)

2005-12-25 Thread Tim Peters
[Martin Blais] > ... > Also, there is something incredibly elegant and simple and compact > about the cons cell, maybe all we need is a good simple cons cell type > and a nice interface on it, so you get both single-linked lists and > trees at the same time... The first "cons cell" C extension for

Re: [Python-Dev] deque alternative (was: Linked lists)

2005-12-25 Thread Aahz
On Sun, Dec 25, 2005, Martin Blais wrote: > > I still haven't had time to cook a proper reply to Guido, but one > thing I see is that many ppl on the list seem to think that because > there aren't many use cases (that they can see), therefore there isn't > much use for a list collection type. Pl

Re: [Python-Dev] deque alternative (was: Linked lists)

2005-12-25 Thread Phillip J. Eby
At 09:10 PM 12/25/2005 -0500, Martin Blais wrote: >I still haven't had time to cook a proper reply to Guido, but one >thing I see is that many ppl on the list seem to think that because >there aren't many use cases (that they can see), therefore there isn't >much use for a list collection type. I

Re: [Python-Dev] deque alternative (was: Linked lists)

2005-12-25 Thread Martin Blais
On 12/25/05, Christian Tismer <[EMAIL PROTECTED]> wrote: > Guido van Rossum wrote: > > > Python's philosophy about (built-in) data types, inherited from ABC, > > is to offer a few powerful clearly distinct choices rather than lots > > of alternatives with overlapping usages. This reduces the time i

[Python-Dev] deque alternative (was: Linked lists)

2005-12-25 Thread Christian Tismer
Guido van Rossum wrote: > Python's philosophy about (built-in) data types, inherited from ABC, > is to offer a few powerful clearly distinct choices rather than lots > of alternatives with overlapping usages. This reduces the time it > takes to choose a data type and reduces the risk of picking th