[Python-Dev] string.find() again (was Re: timsort for jython)

Guido van Rossum guido@python.org
Mon, 05 Aug 2002 14:03:58 -0400


I wrote:
> I personally see no way to defend ('' in 'x') returning false; it's so
> clearly a substring that any definition of substring-ness that
> excludes this seems mathematically wrong, despite your good
> intentions.

However, the backwards compatibility argument makes sense.  It used to
raise an exception and it would probably break code if it stopped
doing so; longer strings are much less likely to be passed by accident
so the need for the exception there is less strong.  I'm of two minds
on this now...

--Guido van Rossum (home page: http://www.python.org/~guido/)