I don't know how 'in' is implemented in Python's sets. But one would imagine that it's O(n). Should we be using another data structure that gives us a faster lookup?