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

Terry Carroll carroll at tjc.com
Fri Feb 20 07:39:48 CET 2004


On Wed, 18 Feb 2004 19:10:06 -0600, Jeff Epler <jepler at unpythonic.net>
wrote:

>On Wed, Feb 18, 2004 at 05:41:10PM +0000, Terry Carroll wrote:
>> With read() instead of readline(), then.
>> 
>> I've certainly run into this using urllib2.
>
>Push the "yucky" while 1: loop into a generator function,
>and then use a regular "for" loop in the multiple places 
>you need to handle a file in this way:

Sure; there's no question that you can usually move awkward code
constructs to a different location in the program.




More information about the Python-list mailing list