Mike Meyer wrote: > "Steve M" <[EMAIL PROTECTED]> writes: >>my_list.find(candidate) >>-returns the index into my_list of the first occurrence of candidate. >>Returns -1 if candidate doesn't occur in my_list. > > Lists don't have a find method. strings do. Why is a good question.
Probably because at one point lists didn't even have the index() method, and when it was suggested and (I believe) Raymond H. added it, I suspect nobody also suggested that implementing find() was a good idea so it wasn't done. And, given both that index() exists and the recent discussion about the potential problems caused by find() returning a valid slice index when it fails, maybe it's _not_ a good idea... -Peter -- http://mail.python.org/mailman/listinfo/python-list