"also" to balance "else" ?

Donn Cave donn at drizzle.com
Tue Jun 14 02:37:13 EDT 2005


Quoth Ron Adam <rrr at ronadam.com>:
| ... The current for-else 
| is IMHO is reversed to how the else is used in an if statement.

Is that all?  As a matter of opinion, this one is fairly simply
an arbitrary choice to assign a positive sense to completion of
the loop predicate.  For search loops, for example, it's clearly
a failure - the loop predicate is there to put a bound on the search,
and to reach that bound is to fail.

Whatever, I don't care if you find this compelling.  My point
is that rather than a case of intuition driven by subconscious
forces beyond our control, the choice between two ways to take
the boolean sense of a loop control is really based on some
logical premises, which we can reconsider if it's productive
to do so.  I prefer this to fantasies about changing the language,
your mileage may vary.

	Donn Cave, donn at drizzle.com



More information about the Python-list mailing list