[Python-ideas] if in for-loop statement
Sven R. Kunze
srkunze at mail.de
Fri Feb 24 04:58:15 EST 2017
On 24.02.2017 05:45, Chris Angelico wrote:
> Don't forget that you can rewrite a "for-if" using two additional
> lines and no indents, rather than one line and one indent:
> for ...:
> if not (...):
That's exactly what I meant by "for+if+continue". At work we even set a
guideline for this to prevent excessive indentation for longer loop bodies.
> So you can take your pick which version you want. Granted, I can still
> see value in the for-if statement, but not enough to justify new
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Python-ideas