Actually, I believe xrange does fancy stuff in `__contains__` to avoid linear membership tests. Fairly sure this is fine.