Forum » Programiranje » [Python] Razlika med Symbol table in Namespace?
[Python] Razlika med Symbol table in Namespace?
MedusasPath ::
Torej, zanima me, v čem je razlika med symbol table in namespace, namreč v "official" tutorialu je omenjeno recimo:
in
Torej kaj ni oboje nek containter, ki preslikuje iz identifikatorjev v dejanske objekte?
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.
in
A namespace is a mapping from names to objects. Most namespaces are currently implemented as Python dictionaries, but that’s normally not noticeable in any way (except for performance), and it may change in the future. Examples of namespaces are: the set of built-in names (containing functions such as abs(), and built-in exception names); the global names in a module; and the local names in a function invocation.
Torej kaj ni oboje nek containter, ki preslikuje iz identifikatorjev v dejanske objekte?
- spremenil: MedusasPath ()
jype ::
MedusasPath> Torej kaj ni oboje nek containter, ki preslikuje iz identifikatorjev v dejanske objekte?
Saj ti piše: locals, globals, builtins sestavljajo imenski prostor.
Saj ti piše: locals, globals, builtins sestavljajo imenski prostor.
Vredno ogleda ...
Tema | Ogledi | Zadnje sporočilo | |
---|---|---|---|
Tema | Ogledi | Zadnje sporočilo | |
» | Skripal (strani: 1 2 3 )Oddelek: Loža | 31993 (17742) | Pac-Man |
» | Kontakt obrazecOddelek: Izdelava spletišč | 2070 (1915) | betmen |
» | Spelling checker v Word-uOddelek: Programska oprema | 6508 (5964) | zvau |
» | NVIDIA gonilnik za LinixOddelek: Operacijski sistemi | 1382 (1253) | borchi |
» | 100%Cpe + ostaloOddelek: Pomoč in nasveti | 2155 (1825) | postar_si |