The in operator uses the Python special method __contains__. The Python documentation about this is here. You can get the source code for this by doing ZZ.__contains__??.
There is the trace function, but it isn't very useful for code in (compiled) Cython files unless you turn on profiling for Cython.