basic if stuff- testing ranges

Peter Otten __peter__ at web.de
Mon Nov 26 03:29:53 EST 2007


Donn Ingle wrote:

>> x in range(1,20) ?
> Sure, that's okay, but it has clarity issues, and is calling a func.

and it requires that x is integral (1.0 is in the range, 1.001 is not),
and becomes dog slow when the range gets larger. Not a good idea.

Peter



More information about the Python-list mailing list