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

Alex Martelli aleax at mac.com
Sat Sep 9 10:54:31 EDT 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 .


Alex
 



More information about the Python-list mailing list