Re: [Python-Dev] elimination of scope bleeding ofiteration variables
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 Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com
Re: [Python-Dev] elimination of scope bleeding ofiteration variables
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 = 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: - Josiah ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com
Re: [Python-Dev] elimination of scope bleeding ofiteration variables
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 details. 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? -- Greg ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com
Re: [Python-Dev] elimination of scope bleeding ofiteration variables
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 see any reason to make it a syntax error. Cheers, Nick. -- Nick Coghlan | [EMAIL PROTECTED] | Brisbane, Australia --- http://www.boredomandlaziness.org ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com
Re: [Python-Dev] elimination of scope bleeding ofiteration variables
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 compiler. The code may be a bad idea, but I don't see any reason to make it a syntax error. My sentiments precisely. Unless someone can come up with a good reason for changing the current semantics, I'm -1. Side note: if people do want to continue discussing this, I think it should go to python-3000. There is absolutely no reason to break currently-running code that happens to use this pattern. -- Aahz ([EMAIL PROTECTED]) * http://www.pythoncraft.com/ Argue for your limitations, and sure enough they're yours. --Richard Bach ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com
Re: [Python-Dev] elimination of scope bleeding ofiteration variables
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 ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com
Re: [Python-Dev] elimination of scope bleeding ofiteration variables
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 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. -- --Guido van Rossum (home page: http://www.python.org/~guido/) ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com
Re: [Python-Dev] elimination of scope bleeding ofiteration variables
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 Delaney ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com