The official tutorial uses the term symbol table in a few places where I would expect the term namespace.
The execution of a function introduces a new symbol table used for the local variables of the function. More precisely, all variable assignments in a function store the value in the local symbol table; whereas variable references first look in the local symbol table, then in the local symbol tables of enclosing functions, then in the global symbol table, and finally in the table of built-in names.
Each module has its own private symbol table, which is used as the global symbol table by all functions defined in the module. Thus, the author of a module can use global variables in the module without worrying about accidental clashes with a user’s global variables.
I found Eli Bendersky's blog where he quotes the symtable module:
Symbol tables are generated by the compiler from AST just before bytecode is generated. The symbol table is responsible for calculating the scope of every identifier in the code.
So it seems like a symbol table precedes a namespace. Yet another quote, from the first source, leads me to believe they also exist at the same time.
The actual parameters (arguments) to a function call are introduced in the local symbol table of the called function when it is called; thus, arguments are passed using call by value (where the value is always an object reference, not the value of the object).1
Is a symbol table involved with the creation of a namespace? Does a symbol table "contain" a namespace or simply information that a namespace contains? In short, how does a symbol table relate to a namespace?