First page Back Continue Last page Summary Graphics
No Declarations in Python
Name scope determined by assignment
- Assignment in block makes name local
- Okay, 1 declaration: global statement
- Can't rebind names in enclosing scopes
Assignment to attribute creates it
Far reaching consequences
- Pass self as first argument to method
- Hard to detect errors statically
Module globals are module attributes
Notes: