PEP 234: Iterators

Bernhard Herzog bh at
Sat May 5 13:26:03 EDT 2001

aahz at (Aahz Maruch) writes:

> In article <nfiI6.83$Yu6.16482 at>,
> Fredrik Lundh <fredrik at> wrote:
> >Aahz Maruch wrote:
> >> Well, yes.  The whole point of this exercise is that xrange() will be
> >> essentially deprecated in 2.2.  There's no more need to create any
> >> new x*() functions.
> >
> >what should you use instead of xrange?
> range() -- at least, I'm assuming that range() will return an iterator
> in the appropriate contexts.

But how does range know in what context it's being called? range is
documented as returning a list and I wouldn't be surprised if there were
code that made use of that fact (in fact there's a place in Sketch where
that fact is used).


Intevation GmbH                       

More information about the Python-list mailing list