Re: [Python-Dev] elimination of scope bleeding ofiteration variables

2006-05-02 Thread Greg Ewing
Delaney, Timothy (Tim) wrote: So would this also be a SyntaxError? for x in stuff: x = somethingelse That would be something to be debated. I don't really mind much one way or the other. -- Greg ___ Python-Dev mailing list

Re: [Python-Dev] elimination of scope bleeding ofiteration variables

2006-05-02 Thread Josiah Carlson
Greg Ewing [EMAIL PROTECTED] wrote: Delaney, Timothy (Tim) wrote: So would this also be a SyntaxError? for x in stuff: x = somethingelse That would be something to be debated. I don't really mind much one way or the other. for line in lines: line =

Re: [Python-Dev] elimination of scope bleeding ofiteration variables

2006-05-02 Thread Greg Ewing
Josiah Carlson wrote: for line in lines: line = line.rstrip() ... I'm generally -0 on the raise a SyntaxError in this particular case, That's a good point. I'm inclined to agree. I think I might have even done something like that recently, but I can't remember the

Re: [Python-Dev] elimination of scope bleeding ofiteration variables

2006-05-02 Thread Nick Coghlan
Greg Ewing wrote: Josiah Carlson wrote: and am +0 on the double use below: for x in y: for x in z: Can anyone think of a plausible use case for that? This really seems more like the domain of pychecker/pylint rather than the compiler. The code may be a bad idea, but I don't

Re: [Python-Dev] elimination of scope bleeding ofiteration variables

2006-05-02 Thread Aahz
On Tue, May 02, 2006, Nick Coghlan wrote: Greg Ewing wrote: Josiah Carlson wrote: and am +0 on the double use below: for x in y: for x in z: Can anyone think of a plausible use case for that? This really seems more like the domain of pychecker/pylint rather than the

Re: [Python-Dev] elimination of scope bleeding ofiteration variables

2006-05-02 Thread Delaney, Timothy (Tim)
Josiah Carlson wrote: for line in lines: line = line.rstrip() ... Exactly the use case I was thinking of (and one I used yesterday BTW). I'm -1 on *dis*allowing reusing a name bound in a for loop in any construct i.e. +1 for the status quo. Tim Delaney

Re: [Python-Dev] elimination of scope bleeding ofiteration variables

2006-05-02 Thread Guido van Rossum
Don't worry. This isn't going to change. Someone please update PEP 3099. On 5/2/06, Delaney, Timothy (Tim) [EMAIL PROTECTED] wrote: Josiah Carlson wrote: for line in lines: line = line.rstrip() ... Exactly the use case I was thinking of (and one I used yesterday

Re: [Python-Dev] elimination of scope bleeding ofiteration variables

2006-05-01 Thread Delaney, Timothy (Tim)
Greg Ewing wrote: for x in stuff: for x in otherstuff: dosomethingelse(x) would be a SyntaxError because the inner loop is trying to use x while it's still in use by the outer loop. So would this also be a SyntaxError? for x in stuff: x = somethingelse Tim