Re: range(,,)

Guido.van.Rossum@cwi.nl
Wed, 24 Aug 1994 15:30:08 +0200

> Playing arround with range() I fell over the fact that range insits in it's
> parameters being ints...
>
> Things like range(1,int(pow(x,0.5))) seem unhandy for a language for rapid
> prototyping and shell programming.
>
> Is it possible to loosen the definition of range to something like
>
> range(from,to,step) produces a list of integers like
> for( i=ceil(from); i<floor(to); i+=floor(step))
>
> to get a friendlier behaviour ?

And what would you expect range(100000.0) to return? What if the
floating point representation is sufficiently fuzzy that this actually
returns range(100001)?

--Guido van Rossum, CWI, Amsterdam <Guido.van.Rossum@cwi.nl>
<URL:http://www.cwi.nl/cwi/people/Guido.van.Rossum.html>