for: else: - any practical uses for the else clause?

Klaas mike.klaas at gmail.com
Fri Sep 29 17:21:25 EDT 2006


Klaas wrote:

> else: does not trigger when there is no data on which to iterate, but
> when the loop terminated normally (ie., wasn't break-ed out).  It is
> meaningless without break.

Sorry, this was worded confusingly.  "else: triggers when the loop
terminates normally, not simply in the case that there is no iterated
data".

-Mike




More information about the Python-list mailing list