» »

[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:

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?

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.


Vredno ogleda ...

TemaSporočilaOglediZadnje sporočilo
TemaSporočilaOglediZadnje sporočilo
»

Skripal (strani: 1 2 3 )

Oddelek: Loža
13131993 (17742) Pac-Man
»

Kontakt obrazec

Oddelek: Izdelava spletišč
62070 (1915) betmen
»

Spelling checker v Word-u

Oddelek: Programska oprema
96508 (5964) zvau
»

NVIDIA gonilnik za Linix

Oddelek: Operacijski sistemi
161382 (1253) borchi
»

100%Cpe + ostalo

Oddelek: Pomoč in nasveti
112155 (1825) postar_si

Več podobnih tem