PEP-0315--Enhanced While Loop: An idea for an alternative syntax
Paul Rubin
http
Wed Feb 18 22:02:45 EST 2004
Jeff Epler <jepler at unpythonic.net> 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