[Tutor] replacing range with xrange

Kent Johnson kent37 at tds.net
Mon Jan 28 16:03:17 CET 2008


bob gailer wrote:

> I disagree based on PEP 3100 (http://www.python.org/dev/peps/pep-3100/)
> 
> Built-in Namespace:
> - Make built-ins return an iterator where appropriate (e.g. range(), 
> zip(), map(), filter(), etc.)
> 
> To be removed:
> - xrange(): use range() instead

Right, that's a good clarification.

xrange() is being renamed to range(), so there will be no xrange() and 
range() will return an iterator rather than a list.

Hmm, does that mean that the arguments to range() will be restricted to 
long integers?

Kent


More information about the Tutor mailing list