21. Symbol Tables
21. Symbol Tables After parsing produces an AST, CPython performs scope analysis. This stage builds symbol tables. A symbol table records how names behave inside each scope. It determines whether a name is local, global, free, cell, parameter, imported, annotated, or referenced from nested scopes. For this source: x = 10 def outer(): y = 20 def inner(): return x + y return inner the parser only knows that names...