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"

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 c

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

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 su

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 severa

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