else in loops (was Re: mutability, namimg, ...)

Aahz Maruch aahz at panix.com
Thu May 10 16:42:27 CEST 2001


In article <MD5K6.9470$sk3.2577512 at newsb.telia.net>,
Fredrik Lundh <fredrik at effbot.org> wrote:
>Mark Jackson wrote:
>>
>> What I *do* find counterintuitive is Python's use of "else" in "while",
>> "for", and "try" constructs.  But that's because it seems backwards
>> relative to its meaning in Python's "if"
>
>backwards?

Well, okay, that's probably an inappropriate word.

>can it be more consistent?

Possibly.  The big difference between the looping structures and the
standard if is that *both* true and false blocks can execute.  Not in
the same iteration of the loop, of course, but still...
-- 
                      --- Aahz  <*>  (Copyright 2001 by aahz at pobox.com)

Androgynous poly kinky vanilla queer het Pythonista   http://www.rahul.net/aahz/
Hugs and backrubs -- I break Rule 6

"Don't be so humble -- you are not that great."  --Golda Meir



More information about the Python-list mailing list