[Python-Dev] Remove str.find in 3.0?
Guido van Rossum
gvanrossum at gmail.com
Sat Aug 27 17:03:35 CEST 2005
On 8/26/05, Josiah Carlson <jcarlson at uci.edu> wrote:
> Taking a look at the commits that Guido did way back in 1993, he doesn't
> mention why he added .find, only that he did. Maybe it was another of
> the 'functional language additions' that he now regrets, I don't know.
There's nothing functional about it. I remember adding it after
finding it cumbersome to write code using index/rindex. However, that
was long before we added startswith(), endswith(), and 's in t' for
multichar s. Clearly all sorts of varieties of substring matching are
important, or we wouldn't have so many methods devoted to it! (Not to
mention the 're' module.)
However, after 12 years, I believe that the small benefit of having
find() is outweighed by the frequent occurrence of bugs in its use.
--
--Guido van Rossum (home page: http://www.python.org/~guido/)
More information about the Python-Dev
mailing list