this made me wonder - I know I can use global variables inside a function definition:
a = 1
def foo():
x = a
foo()
so if this 'a' is a new variable, what happens when the name collides with a global variable? a = 1
def foo():
a = a
foo()
> UnboundLocalError: local variable 'a' referenced before assignment
yuck!