Why no index for tuples or strings ?

Steven D. Majewski (sdm7g@aemsun.med.Virginia.EDU)
Wed, 4 Dec 91 11:36:05 EST

Most of the functions that operate on mutable sequences but NOT on
immutable ones are obviously there because they DO CHANGE the sequence.
BUT: why no string.index() or tuple.index() ?

Is this just an oversight ?
If not, what is the reason?
( Just in case it was the documentation that was wrong, I tried this, and
it does in fact fail. )

>>>from string import lowercase
>>>L = []
>>>T = ()
>>>for x in lowercase:
... L.append( x )
... T = T + ( x, )
...
>>>L.index('k') # this works
10

>>>T.index('k') # these two
>>>lowercase.index('k') # fail

======== "If you have a hammer, find a nail" - George Bush,'91 =========
Steven D. Majewski University of Virginia Physiology Dept.
sdm7g@Virginia.EDU Box 449 Health Sciences Center
Voice: (804)-982-0831 1600 Jefferson Park Avenue
FAX: (804)-982-1616 Charlottesville, VA 22908