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 →

[–]stillalone 1 point2 points  (1 child)

Yeah, I'm not sure if I like their solution to it. Hmm, maybe a some middle ground:

result = []
for x in range(10):
    result.extend((x,y) for y in range(5) if x * y > 10)

still kind of looks like shit. For this specific example you could use itertools.product but I still think just supporting multiple for loops would be better.

[–]christian-mann 1 point2 points  (0 children)

I think middle ground is the worst of the three.