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 yes
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
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
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
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
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:
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-D
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