Avoiding local variable declarations?
bearophileHUGS at lycos.com
bearophileHUGS at lycos.com
Fri Nov 14 03:50:28 EST 2008
Paul McGuire:
> Really? Looking at randrange, it sure seems to do a lot of work in
> pursuit of handling all possible cases for specifying range
> boundaries, step values, etc.
Well, randrange is the simpler thing to read and understand here, and
maybe the one less likely to get wrong too.
But I understand your concerns. The solution is to write a C function
in the random module that implements the randrange in an efficient
way.
Bye,
bearophile
More information about the Python-list
mailing list