
April 23, 2009
7:07 p.m.
On Thu, 23 Apr 2009 18:56:28 -0400, Terry Reedy wrote:
Proposed and rejected.
The difference between
for i in seq: if p(i): do(i)
and
for i in seq if p(i): do(i)
is deletion of ':\n'. Hardly worth the bother.
What about the difference in efficiency? For the second case, you've reduced the number of iterations (by the number of items that your conditional expression has excluded) and eliminated one operation per iteration (evaluation the if statement). Mike