On 25/10/12 03:49, Alan Gauld wrote:

I confess I'm not keen on the else part of a for loop and never
use it, I think it leads to more confusion than anything. It
doesn't do what most folks seem to expect, it should probably be
called 'end' or something similar rather than 'else' IMHO.

I am keen on it and do use it, but I agree with the second sentence.
It took me the longest time to stop thinking of for...else as
meaning "run this block of code if the for loop didn't run at all".
It really is an astonishingly bad choice of keyword, but it is a
useful feature.


--
Steven
_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor

Reply via email to