I came across the Python str.count
function while reading the documentation. I can\'t seem to find any good explanation on the inner working of the function. Wh
Study the source code at https://github.com/python/cpython/blob/master/Objects/stringlib/fastsearch.h
A comment at the top of file explains this much:
fast search/count implementation, based on a mix between boyer- moore and horspool, with a few more bells and whistles on the top. for some more background, see: http://effbot.org/zone/stringlib.htm