What algorithm does Python use to evaluate: if substring in string

Alex Martelli aleax at mac.com
Sat Sep 9 16:54:31 CEST 2006

Tor Erik <torerik81 at gmail.com> wrote:

> I would be surprised if it is the naive:

Yep -- it's "a mix between Boyer-Moore and Horspool with a few more
bells and whistles on the top", as documented and implemented in
Objects/stringlib/fastsearch.h in the Python sources and well discussed
and explained at http://effbot.org/zone/stringlib.htm .


More information about the Python-list mailing list