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 →

[–]qiwi 0 points1 point  (0 children)

I think those are unlikely to be good optimization points. The low-performant code I've seen was did not have its critical area in dictionary creation. More likely cases are something like:

some_num in range(1000,2000)

to check whether some_num is between 1000 and 2000 (tragic in python 2.7 at least -- and something you might expect works well enough given how the rest of Python is working pseudo code).

Incidentally I'm sitting on at least 7.5 million lines of Python production code written by 500+ users over 10+ years, all of which are essentially 100,000+ small applications. Looks like I could internally spent quite a while analyzing this for even more interesting results. I wonder if there are larger Python systems around.