PEP-0315--Enhanced While Loop: An idea for an alternative syntax

Miki Tebeka miki.tebeka at zoran.com
Wed Feb 18 13:57:35 CET 2004


Hell Erik,

> 	do:
> 	    line = inputFile.readline()
> 	while line:
> 	    ...
Just do it with generators:
for line in iter(inputFile.readline, ""):
    ...

Miki



More information about the Python-list mailing list