[pypy-dev] XRange Object [Fixed Patch]

holger krekel hpk at trillke.net
Tue Jul 8 11:46:24 CEST 2003


[holger krekel Tue, Jul 08, 2003 at 11:30:38AM +0200]
> 
>     arr = []
>     for i in xrange(x,y,step):
>         arr.append(i)
>     return arr
> 
> or 
> 
>     arr = []
>     map(arr.append, xrange(x, y, step)
>     return arr

or simply 

    def range(x, y=None, step=1):
        return list(xrange(x,y,step)

:-) holger


More information about the Pypy-dev mailing list