tuple.index()

J. Clifford Dyer webmaster at cacradicalgrace.org
Mon Dec 18 18:21:54 EST 2006


Roy Smith wrote:
> In article <4um6tgF18l1srU1 at mid.individual.net>,
>  greg <greg at cosc.canterbury.ac.nz> wrote:
> 
>> Roy Smith wrote:
>>
>>> The struct does lookup by name, the tuple is inherently index based.
>> I was trying to help people understand the distinction
>> we're talking about by showing an example of the same
>> distinction in another language where it's much clearer.
>>
>> There are a great many ways in which C structs are
>> different from Python tuples, and C arrays are different
>> from Python lists. But they're not the aspects I'm
>> drawing an analogy between.
>>
>> --
>> Greg
> 
> Well, yeah, but it's kind of like saying "a tangerine and an orange are 
> very different things because one of them is like an apple and the other 
> one is like a pear" :-)

Actually, I found the distinction a bit more helpful than that--more
like saying, "a tangerine and a pear are very different things because
one of them is like an orange and the other is like an apple."  Still
not a precise definition, but a useful analogy in many ways.

Cheers,
Cliff



More information about the Python-list mailing list