Incomplete draft: Namespaces
Just van Rossum
just at xs4all.nl
Sun Apr 7 04:17:08 EDT 2002
In article <a8nric$sbb$1 at panix1.panix.com>, aahz at pythoncraft.com (Aahz)
wrote:
> The three execution scopes are function local (hereafter referred to as
> local), module global (hereafter referred to as global), and builtin
> scope. Local scope exists any time Python's instruction pointer is
> inside a function/method. Global scope refers to the currently
> executing module; explicitly accessing a function in another module
> through attributes changes the current module:
>
> from M import f
> f() # f()'s global scope is the current module
> import M
> M.f() # f()'s global scope is now the module M
No: f()'s global scope is always module M. Scoping is static after all.
Or are you saying something different?
Just
More information about the Python-list
mailing list