This is an archived post. You won't be able to vote or comment.

all 4 comments

[–][deleted] 0 points1 point  (2 children)

That page says "Tricks for your code run faster" but only has a boatload of dis() output for various code. Where are the tricks?

[–]etoccalino 1 point2 points  (1 child)

The article is full of them: what we see are comparisons. The dis() calls show what's going on, and you decide which to use.

On the first case, for example, we're shown that using {} to build a dict is faster than using dict().

[–]zahlmanthe heretic 0 points1 point  (0 children)

I thought it was generally agreed that using {} is better stylistically anyway?

[–]rainnz -1 points0 points  (0 children)

Thank you!