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

Paul Rubin http
Thu Feb 19 04:02:45 CET 2004

Jeff Epler <jepler at> writes:

> > I've certainly run into this using urllib2.
> Push the "yucky" while 1: loop into a generator function,

> The "while 1:" loop is now so short that a simple glance can take it all
> in, and the site with the logic uses the much clearer 'for' loop.

Yeah, except now you've bloated up your code with another function.
Assignment expression solves this one too.

More information about the Python-list mailing list