Usage of main()

alex23 wuwei23 at gmail.com
Sat Sep 5 06:46:35 CEST 2009


Carl Banks <pavlovevide... at 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.



More information about the Python-list mailing list