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 stuff on one line.

The only difference between an inadvisable amount of stuff and a
reasonable amount of stuff is the amount.  Don't we already have a
recommended column limit in PEP8?

for y in range(25) for x in range(80): doesn't seem unreasonable to me;
YMMV.

Or maybe you want to put it on multiple lines, but not consuming
indentation levels:

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))
_______________________________________________
Python-ideas mailing list
Python-ideas@python.org
https://mail.python.org/mailman/listinfo/python-ideas
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to