tuple.index()

greg greg at cosc.canterbury.ac.nz
Mon Dec 18 21:37:33 EST 2006


Nick Maclaren wrote:

> Unfortunately, you are confusing the issue, because there are far
> more extraneous aspects than relevant ones, and your view of the
> similarities requires looking at the issue in a very strange way.
> I think that I can see what you mean, but only just.

Each member of a struct has a distinct, predefined
role. Even if they all have the same type, you
can't swap their values around without destroying
the meaning of the data. That's what's meant by
"heterogeneous" in this context -- it's not about
the values themselves, but the way they're used.

This is the kind of thing for which Python tuples
are mainly designed -- use as a struct whose
members happen to be named by integers rather
than strings.

If you still don't understand, then I'm afraid
I've run out of ideas on how to explain it.

--
Greg



More information about the Python-list mailing list