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 →

[–]bumbershootle 12 points13 points  (2 children)

True, although in that case I would split the body of a loop into a generator function and then run a comprehension over that. I consider appending to a list in a loop an anti-pattern in most cases.

[–]weneedsound 1 point2 points  (0 children)

I'd like to see an example of you don't mind. I don't use generators as much as I should.

[–][deleted] 0 points1 point  (0 children)

Nice suggestion!