Question
What deeper point about LEGB Scope and Closures should a senior Python developer mention?
- At senior level, the right answer is that LEGB Scope and Closures exists mostly for historical syntax reasons.
- At senior level, Python removes the tradeoffs around LEGB Scope and Closures, so design choices barely matter in practice.
- At senior level, any approach to LEGB Scope and Closures is equally correct if it passes one small local test.
- Strong senior answers explain what is captured, when the lookup happens, and how to avoid surprising late-bound behavior.
Hint
Look beyond syntax and explain the runtime, API, or design consequence.
Answer and rationale
Correct answer: D. Strong senior answers explain what is captured, when the lookup happens, and how to avoid surprising late-bound behavior.
Strong senior answers explain what is captured, when the lookup happens, and how to avoid surprising late-bound behavior. This is the kind of tradeoff-aware answer senior interviews usually expect.
Track: Python