Re: [Tutor] replacing range with xrange

2008-01-28 Thread Alan Gauld
"bob gailer" <[EMAIL PROTECTED]> wrote >> That's sad to see, I use range to generate lists of integers >> almost as much as I use it for iteration. > FWIW on my computer > l = range(3000) takes under 0.19 seconds > l = list(xrange(300)) under 0.27. > So I don't think performance is an i

Re: [Tutor] replacing range with xrange

2008-01-28 Thread bob gailer
Alan Gauld wrote: >> xrange() is being renamed to range(), so there will be no xrange() >> and >> range() will return an iterator rather than a list. >> > > That's sad to see, I use range to generate lists of integers > almost as much as I use it for iteration. But maybe I'm > unusual in that

Re: [Tutor] replacing range with xrange

2008-01-28 Thread Alan Gauld
> xrange() is being renamed to range(), so there will be no xrange() > and > range() will return an iterator rather than a list. That's sad to see, I use range to generate lists of integers almost as much as I use it for iteration. But maybe I'm unusual in that respect, I do use Python mainly for

Re: [Tutor] replacing range with xrange

2008-01-28 Thread bob gailer
Kent Johnson wrote: > 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

Re: [Tutor] replacing range with xrange

2008-01-28 Thread Kent Johnson
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 c

Re: [Tutor] replacing range with xrange

2008-01-28 Thread bob gailer
Andy Cheesman wrote: > Hi people, > > After watching a nice Google video on Python 3K, and seeing the > forthcoming removal of range, 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(),

Re: [Tutor] replacing range with xrange

2008-01-28 Thread Kent Johnson
Andy Cheesman wrote: > After watching a nice Google video on Python 3K, and seeing the > forthcoming removal of range, I've looked at substitution range with > xrange within my code. Direct substitution works for 90% percent of the > case (i.e. for thing in xrange(number): ), however i can't

Re: [Tutor] replacing range with xrange

2008-01-28 Thread Tim Golden
Andy Cheesman wrote: > Hi people, > > After watching a nice Google video on Python 3K, and seeing the > forthcoming removal of range, I've looked at substitution range with > xrange within my code. Direct substitution works for 90% percent of the > case (i.e. for thing in xrange(number): ),