s.index(x[, i[, j]]) will change the s ?

Terry Reedy tjreedy at udel.edu
Thu Sep 10 18:42:24 EDT 2009


Chris Rebert wrote:
> On Wed, Sep 9, 2009 at 10:00 PM, s7v7nislands<s7v7nislands at gmail.com> wrote:
> <snip?
>> I known index() does not modify the sequence itself. my question is so
>> why the doc put the index() method in the mutable sequence types list?

Because once upon a time, only lists and not tuples had the method.
> 
> Ah, okay. Now I understand your question. I don't know really. I
> suppose it could just as well go under the more general table for
> "6.6. Sequence Types". I'd guess it's under Mutable Sequence Types for
> convenience's sake since .remove() is mutable-only and makes reference
> to the same footnote. You could file a documentation bug:
> http://bugs.python.org

I already did.
http://bugs.python.org/issue4966

Producing an edited version of the doc text from my suggestions is on my 
todo list if no one beats me to it. I need to learn .rst better, though.

tjr




More information about the Python-list mailing list