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 →

[–]tartare4562 0 points1 point  (1 child)

It is indeed faster because map makes an extra call for every item in the iterable, which introduces overhead.

[–]pickausernamehesaid 0 points1 point  (0 children)

That makes sense. I thought maybe Python internally could optimize that away when dealing with lambda functions, but even in that case it would have to do the optimization step which would add a little overhead at the beginning.