temporary scope change

Edward Elliott nobody at 127.0.0.1
Wed Apr 19 01:08:39 EDT 2006


Michael Spencer wrote:
> Just replace:
>     for y in list2:
> with:
>     if True:

Of course.  I knew it would be blindingly obvious.  Sometimes you just 
can't shake the blinders off though.  Thanks.

> Note that neither the `if` nor the `for` statement actually creates a 
> new scope.

Good catch.  I'm used to thinking block = scope.  Old habits die hard I guess.



More information about the Python-list mailing list