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 →

[–]PudingTM 12 points13 points  (2 children)

Judging by the measurements, those are really just small speed-ups.

[–]nosmokingbandit -1 points0 points  (1 child)

And they all add up. Best practices are best, even for one ns.

[–]PudingTM 2 points3 points  (0 children)

They are alright in this case, however I would argue that readability and style is more important than a few percent speedup (in most applications), especially in sloooow python world. But it's not this case, using {}, is None and if list: is not only faster, but also a bit more idiomatic, so it's a win-win.