LEGB
python scoping:
LEGB Rule.
L. Local. (Names assigned in any way within a fuctnion (def or lambda), and not declared global in that function.
E. Enclosing function locals. (Name in the local scope of any and all enclosing functions (def or lambda), form inner to outer.
G. Global (module). Names assigned at the top-level of a module file, or declared global in a def within the file.
B. Built-in (Python). Names preassigned in the built-in names module : open,range,SyntaxError,…
page revision: 0, last edited: 19 Dec 2008 06:18