Re: [Python-Dev] best practices stdlib: purging xrange

2007-05-09 Thread O.R.Senthil Kumaran
* James Y Knight <[EMAIL PROTECTED]> [2007-05-08 11:18:44]: > On May 8, 2007, at 8:49 AM, Armin Rigo wrote: > > On Tue, May 08, 2007 at 09:14:02AM +1000, Anthony Baxter wrote: > >> I'd like to suggest that we remove all (or nearly all) uses of > >> xrange from the stdlib. A quick scan shows that m

Re: [Python-Dev] best practices stdlib: purging xrange

2007-05-09 Thread Terry Reedy
""Martin v. Löwis"" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] |> Just curious why 2to3 would not replace range() with list(range())? | | In most usages of range(), using the 3.0 range() will work just as | well, and be more efficient. If so, which it would seem from range2x fun

Re: [Python-Dev] best practices stdlib: purging xrange

2007-05-08 Thread Martin v. Löwis
> Just curious why 2to3 would not replace range() with list(range())? In most usages of range(), using the 3.0 range() will work just as well, and be more efficient. If I wanted to write code that works in both versions (which I understand is not the 2to3 objective), then I would use range(). If

Re: [Python-Dev] best practices stdlib: purging xrange

2007-05-08 Thread James Y Knight
On May 8, 2007, at 8:49 AM, Armin Rigo wrote: > On Tue, May 08, 2007 at 09:14:02AM +1000, Anthony Baxter wrote: >> I'd like to suggest that we remove all (or nearly all) uses of >> xrange from the stdlib. A quick scan shows that most of the usage >> of it is unnecessary. With it going away in 3.0,

Re: [Python-Dev] best practices stdlib: purging xrange

2007-05-08 Thread Guido van Rossum
On 5/8/07, Armin Rigo <[EMAIL PROTECTED]> wrote: > On Tue, May 08, 2007 at 09:14:02AM +1000, Anthony Baxter wrote: > > I'd like to suggest that we remove all (or nearly all) uses of > > xrange from the stdlib. A quick scan shows that most of the usage > > of it is unnecessary. With it going away in

Re: [Python-Dev] best practices stdlib: purging xrange

2007-05-08 Thread Armin Rigo
Hi Anthony, On Tue, May 08, 2007 at 09:14:02AM +1000, Anthony Baxter wrote: > I'd like to suggest that we remove all (or nearly all) uses of > xrange from the stdlib. A quick scan shows that most of the usage > of it is unnecessary. With it going away in 3.0, and it being > informally deprecate

Re: [Python-Dev] best practices stdlib: purging xrange

2007-05-07 Thread Guido van Rossum
On 5/7/07, Terry Reedy <[EMAIL PROTECTED]> wrote: > > "Guido van Rossum" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > | But why bother? The 2to3 converter can do this for you. > | > | In a sense using range() is more likely to produce broken results in > | 3.0: if your code depen

Re: [Python-Dev] best practices stdlib: purging xrange

2007-05-07 Thread Raymond Hettinger
> I'd like to suggest that we remove all (or nearly all) uses of > xrange from the stdlib. A quick scan shows that most of the usage > of it is unnecessary. With it going away in 3.0, and it being > informally deprecated anyway, it seems like a good thing to go away > where possible. > >Any obj

Re: [Python-Dev] best practices stdlib: purging xrange

2007-05-07 Thread Terry Reedy
"Guido van Rossum" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] | But why bother? The 2to3 converter can do this for you. | | In a sense using range() is more likely to produce broken results in | 3.0: if your code depends on the fact that range() returns a list, it | is broken in

Re: [Python-Dev] best practices stdlib: purging xrange

2007-05-07 Thread Brian Harring
On Tue, May 08, 2007 at 09:14:02AM +1000, Anthony Baxter wrote: > I'd like to suggest that we remove all (or nearly all) uses of > xrange from the stdlib. A quick scan shows that most of the usage > of it is unnecessary. With it going away in 3.0, and it being > informally deprecated anyway, it

Re: [Python-Dev] best practices stdlib: purging xrange

2007-05-07 Thread Guido van Rossum
But why bother? The 2to3 converter can do this for you. In a sense using range() is more likely to produce broken results in 3.0: if your code depends on the fact that range() returns a list, it is broken in 3.0, and 2to3 cannot help you here. But if you use list(xrange()) today, the converter wil

[Python-Dev] best practices stdlib: purging xrange

2007-05-07 Thread Anthony Baxter
I'd like to suggest that we remove all (or nearly all) uses of xrange from the stdlib. A quick scan shows that most of the usage of it is unnecessary. With it going away in 3.0, and it being informally deprecated anyway, it seems like a good thing to go away where possible. Any objections? Ant