Finding non ascii characters in a set of files

"Martin v. Löwis" martin at v.loewis.de
Fri Feb 23 15:20:43 EST 2007


Tim Arnold schrieb:
> That looks much cleaner. I didn't know the 'num' from the enumerate would 
> persist so the except block could report it.

It's indeed guaranteed that the for loop index variables will keep the
value they had when the loop stopped (either through regular
termination, break, or an exception) (unlike list comprehensions, where
the variable also stays, but only as a side effect of the implementation
strategy).

Regards,
Martin



More information about the Python-list mailing list