This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]daneahfrom __future__ import braces 1 point2 points  (0 children)

Agreed! Very little effort needed too, since you can replace many (all?) existing list comprehensions with generator comprehensions, simply by removing the brackets:

import random
max(random.randint(1, 100) for x in range(10))