basic if stuff- testing ranges

Peter Otten __peter__ at web.de
Mon Nov 26 09:29:53 CET 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