On Mon, Aug 27, 2012 at 12:18 AM, Steven D'Aprano <steve+comp.lang.pyt...@pearwood.info> wrote: > Also, built-ins require a name lookup too. As you point out, locals are > special, but Python will search an arbitrarily deep set of nested > nonlocal scopes, then globals, then builtins.
Ah, builtins, forgot that. So yes, global scope involves potentially two name lookups. But nonlocals aren't searched at run time. ChrisA -- http://mail.python.org/mailman/listinfo/python-list