[Python-ideas] Deprecate str.find
ron3200
ron3200 at gmail.com
Wed Jul 20 19:55:13 CEST 2011
On Tue, 2011-07-19 at 23:51 -0700, Larry Bugbee wrote:
> > Steven D'Aprano wrote:
> > In my wishlist for Python 4000 I have:
>
> and sooner would be nicer.
>
> > * list.index renamed to list.find
> > * str.find and list.find return None if the argument is not found
>
> +1
>
> ...and forget throwing an exception if not found. None is much preferred.
This is my preference also.
I also prefer that the ValueError exception not be overused in the
library.
A good test might be how to write a function that finds a substring in a
substring from a larger string.
Cheers,
Ron
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20110720/c9aeba1e/attachment.html>
More information about the Python-ideas
mailing list