Graceful handling of first line
Peter Otten
__peter__ at web.de
Sat Oct 9 02:17:14 EDT 2004
More information about the Python-list mailing list
Sat Oct 9 02:17:14 EDT 2004
- Previous message (by thread): Graceful handling of first line
- Next message (by thread): Graceful handling of first line
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Steven Bethard wrote: > There's still a NameError to catch if you haven't initialized line: > >>>> for line in []: > ... break > ... >>>> line > Traceback (most recent call last): > File "<stdin>", line 1, in ? > NameError: name 'line' is not defined No, you would put code specific to the first line into the loop before the break. > I don't much like the break out of a for loop, because it feels like a > misuse I can understand that. Peter
- Previous message (by thread): Graceful handling of first line
- Next message (by thread): Graceful handling of first line
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list