What is a namespace in Python?
A namespace is a mapping from names to objects, and scope decides which namespace Python checks first.
- Local, enclosing, global, builtins
- LEGB lookup rule
- Avoid name collisions
What is a namespace in Python?
Tagged with scope
A namespace is a mapping from names to objects, and scope decides which namespace Python checks first.
What is a namespace in Python?
A closure happens when an inner function keeps access to variables from its lexical outer scope even after the outer function returns.
Closures, lexical scope, and practical uses of closures in JavaScript
Use `let` and `const` for block scope, remember that `var` is function-scoped, and know that hoisting behaves differently across them.
Variables in JavaScript: var, let, const, scope rules, hoisting, and the temporal dead zone