[EMAIL PROTECTED] writes:

> What's with the index() function of lists throwing an exception on not
> found? Let's hope this is rectified in Python 3. If nothing else, add
> a function that doesn't throw an exception. There are a million
> situations where you can have an item not be in a list and it is not
> an exception situation.

The Python string types have both the method `index()` which throws an
exception and the method `find()` which implements the same behavior but
returns -1 for not-found substrings.  I would naively have assumed the
`list` type to provide both as well, but it provides only `index()`.

Anyone know the reason for this lack of parallelism?

-Marshall

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to