statements in control structures (Re: Conditional Expressions don't solve the problem)

Andrew Dalke dalke at
Fri Oct 26 09:39:01 CEST 2001

Huaiyu Zhu:
>The reason is very simple - the naive translation does not work.  Period.

Okay, I understand now your point.  I misunderstood your point, so
my code was wrong.

Give me enough time and eventually I might figure things out.  :)

>Does the above count as an example?

As an example of a problem with for/else, yes.  As a reason for
the solution you once proposed, no, since iterators are another

>  I can see that
>iterators can solve some of them, but not all.  The problem is more
>complicted than either you or I thought initially.

Well, I'm still not convinced that iterators aren't the right
solution.  I gave a couple iterator examples in my previous response.

William Tanksley's follow-up (with the iterator "up_to_sqrt_of")
describes the same points I would have said on this topic, so I
suggest ending this thread here for that one.

                    dalke at

More information about the Python-list mailing list