Simon Forman wrote: > To me, and perhaps others, "T = > set(xrange(0, 10000, 23))" and "n in T" are somewhat easier to read > and write than "not n % 23 and 0 <= n < 10000", YMMV.
Eh? How is the first easier to read than the second?? You have a nested function call in the first! Regardless, testing if a member is part of a ranged set is always going to be slower. It's the nature of what you're doing. Building a set and then searching it takes much longer than a single modulus and subtraction (which is all an integer comparison is). -- http://mail.python.org/mailman/listinfo/python-list