From python reference manual:
A scope defines the visibility of a name within a block. If a local variable is defined in a block, its scope includes that block.
and
When a name is used in a code block, it is resolved using the nearest enclosing scope.
So it is not obviously from this quotes what scope does mean. Is it true that scope is a collection of bindings name-->value
? And what does mean enclosing scope
? Does it mean that every scope must contain a reference to the enclosing scope
?