[Python-3000] [Python-Dev] xrange vs. int.__getslice__

Guido van Rossum guido at python.org
Tue Jul 4 16:22:27 CEST 2006


Please don't cross-post python-dev and python-3000.

This proposal will not be adopted in Py3k. Instead, range() will
become more like xrange().

--Guido

On 6/13/06, Vladimir 'Yu' Stepanov <vys at renet.ru> wrote:
> You were bothered yet with function xrange ? :) I suggest to replace it.
>
> ---------------------------------------------
>         for i in xrange(100): pass
> vs.
>         for i in int[:100]: pass
> ---------------------------------------------
>
> ---------------------------------------------
>         for i in xrange(1000, 1020): pass
> vs.
>         for i in int[1000:1020]: pass
> ---------------------------------------------
>
> ---------------------------------------------
>         for i in xrange(200, 100, -2): pass
> vs.
>         for i in int[200:100:-2]: pass
> ---------------------------------------------
> _______________________________________________
> Python-Dev mailing list
> Python-Dev at python.org
> http://mail.python.org/mailman/listinfo/python-dev
> Unsubscribe: http://mail.python.org/mailman/options/python-dev/guido%40python.org
>


-- 
--Guido van Rossum (home page: http://www.python.org/~guido/)


More information about the Python-3000 mailing list