[Python-ideas] Deprecate str.find

Mike Graham mikegraham at gmail.com
Sat Jul 16 19:45:00 CEST 2011


On Sat, Jul 16, 2011 at 4:47 AM, Georg Brandl <g.brandl at gmx.net> wrote:
> Am 16.07.2011 05:43, schrieb Mike Graham:
> By the way: str.index() raises ValueError, not IndexError, if the substring
> isn't found.  That's one argument against "the index() API is foolproof,
> while the find() API isn't".
>
> Georg

Embarrassing, though I still think that the str.find API is more
error-prone for the reasons I've given. Thanks for pointing this out!

Mike



More information about the Python-ideas mailing list