[Python-Dev] elimination of scope bleeding ofiteration variables (original) (raw)

Josiah Carlson jcarlson at uci.edu
Tue May 2 10:09:40 CEST 2006


Greg Ewing <greg.ewing at canterbury.ac.nz> 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 = line.rstrip()
    ...

I'm generally -0 on the "raise a SyntaxError" in this particular case, and am +0 on the double use below:

for x in y:
    for x in z:


More information about the Python-Dev mailing list