[Python-ideas] Style for multi-line generator expressions

Clay Sweetser clay.sweetser at gmail.com
Sat Sep 14 07:36:25 CEST 2013

PEP 8 currently lacks any suggestions for how multi-line generator
expressions and list comprehensions should be formatted. In the absence of
any official style suggestion (that I can find), I suggest the style used
the most in the standard library.

 for <target_list> in <container>
 if <condition>]

Note, lines could still be combined where it makes sense, eg, the first two
lines could be combined if they aren't too long.

"Evil begins when you begin to treat people as things." - Terry Pratchett
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20130914/0d075ee2/attachment-0001.html>

More information about the Python-ideas mailing list