Terry J. Reedy <tjre...@udel.edu> added the comment:

Since you ask, here is a extended summary of namespaces. There is one built-in 
namespace.  There is one global namespace for each module, which is also the 
local namespace for top level code in that module.  There is one local 
namespace for each class and function.  There is one nonlocal namespace for 
each nested function.  "At any time during execution" (the beginning of the doc 
sentence targeted by this issue), there are 3 or maybe 4 namespaces accessible 
with simple undotted names. 

Module global and class local namespaces, including nested classes, are 
accessible from without the object with dotted names.  There are rules for 
class and method code about access to superclass namespaces.  Function locals 
are not necessarily accessible with standard python code, but at least in 
cpython, local names can be accessed via code objects.  Default parameter 
values and current nonlocal values, when set, can be accessed via function 
objects.  Dotted names are discussed elsewhere in the tutorial, while function 
and code object introspection is out of scope there.  (And off topic for this 
issue ;-).

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue26205>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to