Mapa mental
Scope
Conteúdo do mapa
Scope
Is the range of statements in which the variable is visible.
- A variable is local in a program unit or block if it is declared there. The nonlocal variables of a program unit or block are those that are visible within the program unit or block but are not declared there. Global variables are a special category of nonlocal variables
Static Scoping
- Binding names to nonlocal variables called static scoping
- Static scoping is so named because the scope of a variable can be statically determined— that is, prior to execution.
- Whether a variable is global or local in a function is determined before the function is called, i.e. statically.
- For example: a = 1 b = 2 def func1(): c = 3 print func1.__code__.co_varnames # prints ('c',)
- Whether a variable is global or local in a function is determined before the function is called, i.e. statically.
- Static scoping is so named because the scope of a variable can be statically determined— that is, prior to execution.
- Binding names to nonlocal variables called static scoping
Informações
- Descrição
- Mapa Mental sobre Scope, criado por sebastian perea em 15-02-2019.
- Criado por
- sebastian perea
- Visualizações
- 1
- Avaliação