tuple.index()

Nick Maclaren nmm1 at cus.cam.ac.uk
Sat Dec 16 08:24:10 EST 2006


In article <4583ED06.5000104 at mbi.ucla.edu>,
James Stroud <jstroud at mbi.ucla.edu> writes:
|> Christoph Zwerschke wrote:
|> 
|> > "Inhomogenous" in some meaning of the word --> tuple
|> 
|> I think that you have nailed it here. I don't think anyone on this list 
|> is capable of giving a "concrete" (as you have put it) operational 
|> definition of "inhomogenous". They will resort to use cases and thus 
|> cloud the definition with programming philosophy.

Yes, I can.  Here is one:

    A collection is inhomogeneous if, for some attribute that is needed
    for at least one action on at least one element of the collection,
    the attribute is not shared by all elements of the collection.

Yes, this means that the concept of inhomogeneity depends on the use to
which a collection is put, and not just on the collection.

|> So, programming philosophy, whether it will be admitted or not, is fully 
|> responsible for the exclusion of index() from the tuple interface.

Agreed.

|> But perhaps we could take "not necessarily homogenous" to be the 
|> operational definition of "inhomogenous". Of course then we would have 
|> to define necessary...

It's not necessary :-)  Lists, in Python, are no more homogeneous than
tuples in any sense that I have located.  As I posted earlier, if
anyone knows of one, please tell me.


Regards,
Nick Maclaren.



More information about the Python-list mailing list