Python multi-line comprehensions: Formatting for readability

Python multi-line comprehensions: Formatting for readability

Make your Python comprehensions easier to read, write, and debug with multiple lines.

# squares of odd ints
[n**2                # like SQL's SELECT
 for n in range(10)  # like SQL's FROM
 if n % 2]           # like SQL's WHERE

# better than:
[n**2 for n in range(10) if n%2]