>>
>>i always use the structure analogy. if you view (width, height) as a
>>structure,
>>use a tuple. if you view it a sequence, use a list. in this example, i view
>>it
>>as a stucture, so i would use (width, height) as a tuple.
>
>
> Right, but there's an unfortunate ambiguity in the te
In article <[EMAIL PROTECTED]>,
Bryan <[EMAIL PROTECTED]> wrote:
> [EMAIL PROTECTED] wrote:
> > In this particular case, it seems that (width,height) looks nicer. But
> > I think otherwise, list constuct is easier to read, even though it is
> > supposed to be slower.
> >
> > With list you can :
[EMAIL PROTECTED] wrote:
> In this particular case, it seems that (width,height) looks nicer. But
> I think otherwise, list constuct is easier to read, even though it is
> supposed to be slower.
>
> With list you can :
> [a] + [ x for x in something ]
>
> With tuple it looks like this :
> (a,) +
In this particular case, it seems that (width,height) looks nicer. But
I think otherwise, list constuct is easier to read, even though it is
supposed to be slower.
With list you can :
[a] + [ x for x in something ]
With tuple it looks like this :
(a,) + tuple(x for x in something)
I think the li
It's simple: if you want to modify the data structure after it has been
created, use lists, otherwise tuples.
Tuples are much more memory efficient, so your program will consume
less memory and probably run faster. So preferably use tuples. However
with tuples you can't do:
t[0] = 'new value'
t.ap