As far as I understand, when I do 'foo' in 'abcfoo'
in Python, the interpreter tries to invoke 'abcfoo'.__contains__('foo')
under the hood.
This is a string matching (aka searching) operation that accepts multiple algorithms, e.g.:
How do I know which algorithm a given implementation may be using? (e.g. Python 3.8 with CPython). I'm unable to this information looking at e.g. the source code for CPython for string. I'm not familiar with its code base, and e.g. I can't find the __contains__
defined for it.