<br><div class="gmail_quote">On Thu, Oct 15, 2009 at 6:39 PM, Chris Rebert <span dir="ltr"><<a href="mailto:clp2@rebertia.com">clp2@rebertia.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">

<div><div></div><div class="h5">Nanjundi meant "index method" as in "a method .index()" (i.e. a method<br></div></div>
named "index") which searches through the container for the given item<br>
and returns the index of the first instance of said item, like<br>
list.index() does.<br><br></blockquote><div>Interesting interpretation.. but I just gave it a try.<br><br>>>> a = (1,2,3,4)<br>>>> a<br>(1, 2, 3, 4)<br>>>> a.index(3)<br>2<br>>>> a.index(5)<br>

Traceback (most recent call last):<br>  File "<stdin>", line 1, in <module><br>ValueError: tuple.index(x): x not in tuple<br><br>So my Python is saying that tuples do implement .index() method. What gives?<br>

<br>Or maybe the diveintopython version he's quoting is out of date?<br><br>Cheers,<br>Xav <br></div></div>