In this question, I'm having an argument with a commenter who argues that
for t in threads:
t.join()
would be better than
[t.join() for t in threads]
Leaving the matter of "abusing comprehensions" aside - I tend to agree but I would like a one-liner for this: How (in-)efficient is my version (the second one) really?. Does Python materialize list comprehensions always / in my case or does it use a generator internally?
Would map(lambda t: t.join(), threads)
be more efficient? Or is there another way to apply the function to each element in the list threads
?