for what are for/while else clauses
aahz at pythoncraft.com
Sat Nov 22 20:12:02 CET 2003
In article <258fd9b8.0311220938.3210484c at posting.google.com>,
Magnus Lyck? <magnus at thinkware.se> wrote:
>On the other hand, I only think it's in the case of a break
>in block that...
> print "Loop finished"
>...will behave differently than...
>print "Loop finished"
>So, unless you use a break in the block, the else statement is just
>noise: an extra line of code and additional whitespace for the
While technically correct, I don't think you could claim that it's "just
noise" in this example:
for ORlist in includes:
for filter in ORlist:
for field in curr_fields:
for item in record[field]:
if match(item, filter):
Aahz (aahz at pythoncraft.com) <*> http://www.pythoncraft.com/
Weinberg's Second Law: If builders built buildings the way programmers wrote
programs, then the first woodpecker that came along would destroy civilization.
More information about the Python-list