On 02/01/13 17:04, Mike Meyer wrote:
Oleg Broytman
wrote: Well, some warts are quite well-known. My counter overflows when I try to count how many times anonymous code blocks have been proposed and rejected. IIRC Mr. van Rossum admitted that for/else was a design mistake.
As I recall it, that wasn't because they were a bad idea per se, but because the minor upside they provide isn't worth the confusion they create for newcomers.
There would be a lot less confusion if they weren't called "else". Even now, I have to explicitly remind myself that the else block doesn't run if the for loop is empty, but *after* the for block. # Python 4000 proposal: for x in seq: ... then: # this is skipped by a break else: # this runs only if seq is empty -- Steven