How (in)efficient is a list comprehension if you don't assign it?

后端 未结 4 1914
北恋
北恋 2020-12-21 00:08

In this question, I\'m having an argument with a commenter who argues that

for t in threads:
    t.join()

would be better than



        
4条回答
  •  一向
    一向 (楼主)
    2020-12-21 01:04

    If you want a one-liner why not just do for t in threads: t.join()?

    Seems like the simplest solution to me, and likely to be the fastest too (though really, the overhead of joining threads is likely to dwarf anything else IMO)

提交回复
热议问题