[Python-ideas] Deprecate str.find

Ethan Furman ethan at stoneleaf.us
Fri Jul 15 19:34:03 CEST 2011


Devin Jeanpierre wrote:
> Strings don't even bother to be compatible with .find, if you pass in
> an index that was returned by .find() you might just get the wrong
> result. It's pretty much only ever useful in the if check, which is in
> essence identical to the try-except, except it adds the ability to
> forget to check and produce incorrect behaviour -- this is not a feature.

Hind-sight -- what a great thing!  I do think None would be a better 
return value.  I suspect the odds of that changing now are pretty slim, 
though.

~Ethan~



More information about the Python-ideas mailing list