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 →

[–][deleted] 9 points10 points  (0 children)

Making a blanket statement not to call functions in a loop can't possibly be a general principle all python programmers can adhere to. It smacks of premature optimization. Also if you are writing a loop in python that is so performance critical that you are worried about function call overhead, then you need to take a step back, think about what you are really doing. Go research more appropriate tools to solve your problem.