Re: Lists vs tuples (newbie)

2007-05-25 Thread Hendrik van Rooyen
"Neil Cerutti" <[EMAIL PROTECTED]> wrote: > On 2007-05-22, Duncan Booth <[EMAIL PROTECTED]> wrote: > > "Hendrik van Rooyen" <[EMAIL PROTECTED]> wrote: > > > >> Aside from the hashing issue, there is nothing that a tuple can do > >> that can't be done as well or better by a list. > > > > There a

Re: Lists vs tuples (newbie)

2007-05-24 Thread Duncan Booth
"Hendrik van Rooyen" <[EMAIL PROTECTED]> wrote: > "Duncan Booth" <[EMAIL PROTECTED]> wrote: >> "Hendrik van Rooyen" <[EMAIL PROTECTED]> wrote: >> >> > Aside from the hashing issue, there is nothing that a tuple can do >> > that can't be done as well or better by a list. >> >> There are a few oth

Re: Lists vs tuples (newbie)

2007-05-24 Thread Hendrik van Rooyen
"Duncan Booth" <[EMAIL PROTECTED]> wrote: > "Hendrik van Rooyen" <[EMAIL PROTECTED]> wrote: > > > Aside from the hashing issue, there is nothing that a tuple can do > > that can't be done as well or better by a list. > > There are a few other cases where you have to use a tuple, for example in

Re: Lists vs tuples (newbie)

2007-05-23 Thread Tim Roberts
Neil Cerutti <[EMAIL PROTECTED]> wrote: > >I use tuples simply because of their mellifluous appellation. +1 QOTW. -- Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: Lists vs tuples (newbie)

2007-05-23 Thread Neil Cerutti
On 2007-05-22, Duncan Booth <[EMAIL PROTECTED]> wrote: > "Hendrik van Rooyen" <[EMAIL PROTECTED]> wrote: > >> Aside from the hashing issue, there is nothing that a tuple can do >> that can't be done as well or better by a list. > > There are a few other cases where you have to use a tuple, for > ex

Re: Lists vs tuples (newbie)

2007-05-22 Thread Duncan Booth
"Hendrik van Rooyen" <[EMAIL PROTECTED]> wrote: > Aside from the hashing issue, there is nothing that a tuple can do > that can't be done as well or better by a list. There are a few other cases where you have to use a tuple, for example in a try..except statement the exception specification mus

Re: Lists vs tuples (newbie)

2007-05-21 Thread Hendrik van Rooyen
"Szabolcs" <[EMAIL PROTECTED]> wrote: > > I was wondering about why are there both tuples and lists? Is there > anything I can do with a tuple that I cannot do with a list? > > In what circumstances is it advantageous to use tuples instead of lists? > Is there a difference in performance? > >

Re: Lists vs tuples (newbie)

2007-05-21 Thread Alexander Schmolck
Szabolcs <[EMAIL PROTECTED]> writes: > Thanks for all the replies! > > Phoe6 wrote: >> 1) Return values from a function. When you return multiple values >> from a function. You store them as a tuple and access them >> individually rather then in the list, which bear the danger of being >> modifie

Re: Lists vs tuples (newbie)

2007-05-21 Thread Szabolcs
Thanks for all the replies! Phoe6 wrote: > 1) Return values from a function. When you return multiple values > from a function. You store them as a tuple and access them > individually rather then in the list, which bear the danger of being > modified. > Look up the standard library itself and yo

Re: Lists vs tuples (newbie)

2007-05-21 Thread Phoe6
On May 21, 4:48 pm, Szabolcs <[EMAIL PROTECTED]> wrote: > In what circumstances is it advantageous to use tuples instead of lists? > Is there a difference in performance? > As you should not, tuples are immutable while lists are mutable. You can think of all the scenarios where immutable datatype

Re: Lists vs tuples (newbie)

2007-05-21 Thread rzed
Szabolcs <[EMAIL PROTECTED]> wrote in news:[EMAIL PROTECTED]: > > I was wondering about why are there both tuples and lists? Is > there anything I can do with a tuple that I cannot do with a > list? > > In what circumstances is it advantageous to use tuples instead > of lists? Is there a diffe

Re: Lists vs tuples (newbie)

2007-05-21 Thread Duncan Booth
Szabolcs <[EMAIL PROTECTED]> wrote: > > I was wondering about why are there both tuples and lists? Is there > anything I can do with a tuple that I cannot do with a list? > > In what circumstances is it advantageous to use tuples instead of lists? > Is there a difference in performance? > > I

Lists vs tuples (newbie)

2007-05-21 Thread Szabolcs
I was wondering about why are there both tuples and lists? Is there anything I can do with a tuple that I cannot do with a list? In what circumstances is it advantageous to use tuples instead of lists? Is there a difference in performance? I am still learning Python, so please be gentle ... Sz