Re: [Python-3000] end scope of iteration variables after loop

2008-04-18 Thread Nicholas T
Amaury - I think it's generally cleaner code to write for myObject in someList: if myObject.fits(): process(myObject) break than for myObject in someList: if myObject.fits(): break process(myObject) I see from csv.py how it could simplify thing

Re: [Python-3000] end scope of iteration variables after loop

2008-04-18 Thread Facundo Batista
2008/4/18, Nicholas T <[EMAIL PROTECTED]>: > Amaury - I think it's generally cleaner code to write > for myObject in someList: > if myObject.fits(): >process(myObject) > break > than >for myObject in someList: > if myObject.fits(): > break >

Re: [Python-3000] end scope of iteration variables after loop

2008-04-18 Thread Richard Thomas
I like that loop variables end up still in scope, as demonstrated so far on this list it is quite useful, but only when there is a break somewhere. The one that confuses me, therefore, is the dummy variables in a generator expression leaking into the scope defining that expression. Hence: x = 0 L

Re: [Python-3000] end scope of iteration variables after loop

2008-04-18 Thread Alex Martelli
On Fri, Apr 18, 2008 at 8:29 AM, Richard Thomas <[EMAIL PROTECTED]> wrote: > I like that loop variables end up still in scope, as demonstrated so > far on this list it is quite useful, but only when there is a break > somewhere. The one that confuses me, therefore, is the dummy variables > in a

Re: [Python-3000] end scope of iteration variables after loop

2008-04-18 Thread Robin Stocker
Richard Thomas schrieb: > I like that loop variables end up still in scope, as demonstrated so > far on this list it is quite useful, but only when there is a break > somewhere. The one that confuses me, therefore, is the dummy variables > in a generator expression leaking into the scope defining t

Re: [Python-3000] end scope of iteration variables after loop

2008-04-18 Thread Greg Ewing
Alex Martelli wrote: > LCs were originally designed to leak Well, they weren't really *designed* to leak, it was just a side effect of the implementation. It seems to have been decided that it was better to keep it that way than risk breaking things that might depend on it. Personally I would rat

Re: [Python-3000] Displaying strings containing unicode escapes

2008-04-18 Thread atsuo ishimoto
2008/4/17, Guido van Rossum <[EMAIL PROTECTED]>: > For those of us with less capable IO devices, setting the error flag > for stdout and stderr to backslashreplace is probably the best > solution (and it solves more problems than just repr()). > Some thought on Points I found while investigati