How is string.find implemented in CPython?

后端 未结 3 1800
囚心锁ツ
囚心锁ツ 2020-12-19 03:52

I was wondering if the \'find\' method on strings was implemented with a linear search, or if python did something more sophisticated. The Python documentation doesn\'t disc

3条回答
  •  悲哀的现实
    2020-12-19 04:26

    You should be able to find it in Objects/stringlib/find.h, although the real code is in fastsearch.h.

提交回复
热议问题