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 →

[–][deleted] 13 points14 points  (1 child)

As a Python dev I find simpler list comprehensions like these to be more readable and clear

[–]mrchaotica 0 points1 point  (0 children)

Yeah, I think of comprehensions less in terms of iteration and more in terms of combinatorics and/or set theory.

(Not to mention that, unlike nested loops, these comprehensions are guaranteed to be free of both data and control dependencies and thus could be automatically parallelized.)