Yes, I am aware of all these options, and still think that the approach I outlined is the most viable.
It already exists as syntax (in comprehensions).
There is some similarities to the “conditional statements” proposal, but I think that that one opens quite a can of edge cases.
It’s orthogonal to the context manager proposal.
It’s much simpler than either the comprehension or filter options, which are the current workarounds.
Whereas I would tend to see a slowly emerging pattern … people want to have things conditionally executed with an if statement at the end.
This proposal is strictly about in-loop filtering, not any arbitrary execution. It is also in line with existing syntax of comrehensions (which were originally modelled after loops).
OK, reading through these threads I realise that the damage has already been done by allowing if expressions to have different syntax in comprehensions from the basic loops. So we can’t implement this idea without breaking backward compatibility, even taking into account that if..else is extremely rarely used in for loops.