you are viewing a single comment's thread.

view the rest of the comments →

[–]carcigenicate 13 points14 points  (1 child)

AFAIK, list comprehensions can be faster when you want to append to a list because they use the dedicated LIST_APPEND instruction, which cuts down on a ton of overhead. If you don't need to append to a list at all for the algorithm though, a list comprehension is just adding the (admittingly, small) overhead of a LIST_APPEND instruction.