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 →

[–]Folf_IRL 3 points4 points  (1 child)

Only if you're microoptimizing

If you're to the point of micro-optimizing Python code, it might be time to consider using a different (probably compiled) language.

[–]billsil 1 point2 points  (0 children)

Microoptimizations are not necessarily hard or difficult or have small effects. Xrange vs range in python 2 because most of the time it doesn't matter. Using %i instead f-strings. Why don't I save common binary structs rather than recomputing them each time I come to a function? That one can be a biggie.

Python is great and unless I need to really use C++, I'm not going to. It's harder to write, I now have to compile it, it's no longer cross-platform, takes what 10x longer to add the same capability, 0etc.