4 ms·
Designing Sane Scoping Rules
- bakery2k 10y agoThese rules are essentially a simplification (`global` keyword removed) of those used in Python 3. They may be the simplest rules possible without requiring variable declarations, but they have a couple of problems: 1. A typo on the LHS of an assignment will create a new variable rather than being flagged as an error. 2. There is no way to create variables which are local to the current block, for example, the body of a loop.