Re: Tuples vs Lists: Semantic difference

2007-03-01 Thread Bjoern Schliessmann
Ben Finney wrote: Bjoern Schliessmann [EMAIL PROTECTED] Explain. Well, since you ask so politely :-) I admit, sometimes I'm a little short-spoken ;) I know tuples as immutable lists ... That's a common misconception. [...] Thanks for pointers, there's more to it than I suspected.

Re: Tuples vs Lists: Semantic difference (was: Extract String From Enclosing Tuple)

2007-03-01 Thread bearophileHUGS
George Sakkis, I agree with the things you say. Sometimes you may have a sequence of uniform data with unknown len (so its index doesn't have semantic meaning). You may want to use it as dict key, so you probably use a tuple meant as just an immutable list. I don't know Ruby, but I think it allows

Re: Tuples vs Lists: Semantic difference (was: Extract String From Enclosing Tuple)

2007-03-01 Thread MonkeeSage
On Mar 1, 5:02 am, [EMAIL PROTECTED] wrote: I don't know Ruby, but I think it allows such purposes with a freezing function. In ruby all objects can be frozen (freeze is a method on Object, from which all other objects derive), not just Arrays (Arrays == lists in python; ruby has no built-in

Re: Tuples vs Lists: Semantic difference

2007-03-01 Thread Ben Finney
George Sakkis [EMAIL PROTECTED] writes: On Feb 28, 10:45 pm, Ben Finney wrote: Tuples are intended for use as heterogeneous data structures [...] Lists are intended for use as homogeneous sequences [...] Nice, that's a good summary of the straw man arguments about the true distinction

Tuples vs Lists: Semantic difference (was: Extract String From Enclosing Tuple)

2007-02-28 Thread Ben Finney
Bjoern Schliessmann [EMAIL PROTECTED] writes: Ben Finney wrote: A tuple implies a meaning associated with each position in the sequence (like a record with a positional meaning for each field), a list implies the opposite (a sequence with order but not meaning associated with each

Re: Tuples vs Lists: Semantic difference (was: Extract String From Enclosing Tuple)

2007-02-28 Thread George Sakkis
On Feb 28, 10:45 pm, Ben Finney [EMAIL PROTECTED] wrote: Bjoern Schliessmann [EMAIL PROTECTED] writes: I know tuples as immutable lists ... That's a common misconception. And this catch phrase, that's a common misconception, is a common aping of the BDFL's take on this. As several long

Re: tuples vs lists

2005-01-12 Thread Antoon Pardon
Op 2005-01-11, Reinhold Birkenfeld schreef [EMAIL PROTECTED]: Antoon Pardon wrote: Op 2005-01-10, Bruno Desthuilliers schreef [EMAIL PROTECTED]: Antoon Pardon a écrit : Op 2005-01-08, Bruno Desthuilliers schreef [EMAIL PROTECTED]: worzel a écrit : I get what the difference is between a

Re: tuples vs lists

2005-01-11 Thread Antoon Pardon
Op 2005-01-10, Bruno Desthuilliers schreef [EMAIL PROTECTED]: Antoon Pardon a écrit : Op 2005-01-08, Bruno Desthuilliers schreef [EMAIL PROTECTED]: worzel a écrit : I get what the difference is between a tuple and a list, but why would I ever care about the tuple's immuutability? Because,

Re: tuples vs lists

2005-01-10 Thread Gerrit
Steve Holden wrote: worzel wrote: 'Two-Pull' it is then, thanks. Well, it might be Two-Pull in American, but in English it's tyoopl -- NOT choopl (blearch!). I've also heard people say tuppl. So, basically, say whatever you want. Language is about communication :-) Or just write it down

Re: tuples vs lists

2005-01-10 Thread Antoon Pardon
Op 2005-01-08, Bruno Desthuilliers schreef [EMAIL PROTECTED]: worzel a écrit : I get what the difference is between a tuple and a list, but why would I ever care about the tuple's immuutability? Because, from a purely pratical POV, only an immutable object can be used as kay in a dict.

Re: tuples vs lists

2005-01-10 Thread Bruno Desthuilliers
Antoon Pardon a écrit : Op 2005-01-08, Bruno Desthuilliers schreef [EMAIL PROTECTED]: worzel a écrit : I get what the difference is between a tuple and a list, but why would I ever care about the tuple's immuutability? Because, from a purely pratical POV, only an immutable object can be used as

tuples vs lists

2005-01-08 Thread worzel
I get what the difference is between a tuple and a list, but why would I ever care about the tuple's immuutability? Also, do you say 'too-ple' or 'chu-ple' - if you get my drift. (tomato or tomato kind of thing) TIA -- http://mail.python.org/mailman/listinfo/python-list

Re: tuples vs lists

2005-01-08 Thread Bruno Desthuilliers
worzel a écrit : I get what the difference is between a tuple and a list, but why would I ever care about the tuple's immuutability? Because, from a purely pratical POV, only an immutable object can be used as kay in a dict. So you can use tuples for 'composed key'. Bruno --

Re: tuples vs lists

2005-01-08 Thread Steve Horsley
worzel wrote: I get what the difference is between a tuple and a list, but why would I ever care about the tuple's immuutability? Mainly for security and speed. Many library functions return info by returning a reference to an internally held tuple, and could be damaged / compromised / corrupted

Re: tuples vs lists

2005-01-08 Thread worzel
Cheers - thanks for the feedback guys - pretty much answers the question for me. 'Two-Pull' it is then, thanks. Steve Horsley [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] worzel wrote: I get what the difference is between a tuple and a list, but why would I ever care about

Re: tuples vs lists

2005-01-08 Thread Steve Holden
worzel wrote: Cheers - thanks for the feedback guys - pretty much answers the question for me. 'Two-Pull' it is then, thanks. Well, it might be Two-Pull in American, but in English it's tyoopl -- NOT choopl (blearch!). I've also heard people say tuppl. So, basically, say whatever you want.

Re: tuples vs lists

2005-01-08 Thread Irmen de Jong
Steve Holden wrote: Well, it might be Two-Pull in American, but in English it's tyoopl -- NOT choopl (blearch!). I've also heard people say tuppl. Probably the same ones who attend Tuppl-ware parties. --Irmen -- http://mail.python.org/mailman/listinfo/python-list

Re: tuples vs lists

2005-01-08 Thread worzel
yes, tyoopl - thats what I meant by 'choo-ple' (not v good at the phonetics) As a scouse git (though living in Australia), I would definitely say 'tyoopl'. Steve Holden [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] worzel wrote: Cheers - thanks for the feedback guys - pretty

Re: tuples vs lists

2005-01-08 Thread Sean Dolan
worzel wrote: I get what the difference is between a tuple and a list, but why would I ever care about the tuple's immuutability? Also, do you say 'too-ple' or 'chu-ple' - if you get my drift. (tomato or tomato kind of thing) TIA I use the Festival Speech Synthesis System to learn