Re: [Python-Dev] Why .index() is not a method of all sequence types ? Terry Reedy wrote:
 > "Joost Behrends"  wrote in message
 > news:20080313010923.d1bc7ee9.webmaster@h-labahn.de...
 > | With such a tuple tp i tried 'ix = tp.index(...)' recently and was
 > | astonished to learn, that this doesn't work. Since we have '... in tp'
 > | for me it seems, that it should make very little difference in
 > | the interpreter's code, if .index() would be a method of any sequence,
 > | mutable or not. Such a small difference, that this minor change 
wouldn't
 > | deserve a PEP.
 >
 > I believe .index() is part of the 3.0 sequence protocol and hence has 
been
 > added to tuples for 3.0.  Don't know if has been or will be 
backported to
 > 2.6.

Python 2.6a1+ (trunk:61289M, Mar  7 2008, 19:45:46)
[GCC 4.1.3 20070929 (prerelease) (Ubuntu 4.1.2-16ubuntu2)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
 >>> 'index' in dir(tuple)
True

Cheers,
Nick.

-- 
Nick Coghlan   |   uytankmf@gmail.com   |   Brisbane, Australia
---------------------------------------------------------------
             http://www.boredomandlaziness.org
_______________________________________________
Python-Dev mailing list
zvllln-eum@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: http://mail.python.org/mailman/options/python-dev/python-dev%40tangomu.com


