Carl Banks <pavlovevide...@gmail.com> wrote: > Sorry, alex, unfortunately you are wrong, although it's understandable > that you've missed this. > [...] > The speedup comes because local lookups are much faster. Accessing a > local is a simple index operation, and a nonlocal is a pointer deref > or two, then an indexing. However for global variables the object is > looked up in a dictionary.
Interesting. I guess at some point I should try to understand what is going on under the covers :) Thanks for the clarification. -- http://mail.python.org/mailman/listinfo/python-list