[Python-Dev] Re: Dynamic nested scopes

Moshe Zadka Moshe Zadka <moshez@math.huji.ac.il>
Thu, 2 Nov 2000 17:26:20 +0200 (IST)


On Wed, 1 Nov 2000, Guido van Rossum wrote:

> [MAL]
> > Dynamic nested scopes is another topic... those are *very*
> > useful; especially when it comes to avoiding global variables
> > and implementing programs which work using control objects
> > instead of global function calls.
> 
> Marc-Andre, what are Dynamic nested scopes?

If MAL means dynamic scoping (which I understood he does), then this 
simply means:

when looking for a variable "foo", you first search for it in the local
namespace. If not there, the *caller's* namespace, and so on. In the
end, the caller is the __main__ module, and if not found there, it is
a NameError.
--
Moshe Zadka <moshez@math.huji.ac.il> -- 95855124
http://advogato.org/person/moshez