Feb-22-2017, 11:20 AM
I came across on the web on such thin optimisations wich can impact a significant difference when it comes to iterating over hundreds of thousands or millions of objects.
So, basically Python search first the local scope for functions and other objects then the globals. And assignments like this make sense:
So, basically Python search first the local scope for functions and other objects then the globals. And assignments like this make sense:
def squared(big_num): results = [] append = list.append for n in big_num: results.append(n**2) return results