Re: [Python-ideas] if-statement in for-loop

2016-09-30 Thread Random832
On Tue, Sep 27, 2016, at 17:36, Greg Ewing wrote: > Erik Bray wrote: > > Then following my own logic it > > would be desirable to also allow the nested for loop syntax of list > > comprehensions outside them as well. > > The only use for such a syntax would be to put > an inadvisable amount of stu

Re: [Python-ideas] if-statement in for-loop

2016-09-30 Thread Alexander Heger
> > for x in seq1 if p1(x)\ > for y in seq2 if p2(y)\ > for z in seq3 if p3(z): > result.append(f(x, y, z)) > It think it is not uncommon to have nested loops, maybe with an if/continue statement at the beginning, with only one logical block that then should go down only one indentation level

Re: [Python-ideas] if-statement in for-loop

2016-09-30 Thread Nick Coghlan
On 1 October 2016 at 10:25, Alexander Heger wrote: > I think wasting of indentation levels for a single logical block should be > avoided if possible to make the code more legible, otherwise one hits the > suggested line length limit too fast - suppose this is now inside a method, > you already lo