Python source code for built-in “in” operator
I am trying to find the implementation of the built-in in operator in the (C) Python source code. I have searched in the built-in functions source code, bltinmodule.c , but cannot find the implementation of this operator. Where can I find this implementation? My goal is to improve the sub-string search in Python by extending different C implementations of this search, although I am not sure if Python already uses the idea I have. To find the implementation of any python operator, first find out what bytecode Python generates for it, using the dis.dis function : >>> dis.dis("'0' in ()") 1 0