Grant Edwards wrote:
> Using xrange as somebody else suggested is also insane.

Sorry about that, I somehow got the misguided notion that xrange defines 
its own __contains__, so that it would be about the same speed as using 
comparison operators directly. I figured the OP might have a better 
reason for wanting to use range() than his post mentioned -- perhaps the 
range to check was being passed from a function, and it would be easier 
to pass an object than a tuple of lower and upper bound -- but since 
xrange does looping for a membership test, my suggestion was indeed insane.
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to