Open
Description
The interpreter currently doesn't check if a variable is being read before being assigned to in a scope.
It leads to bugs like this:
x = 10
def f():
x = x + 1 # accidentally reading the variable from global, but writing in local
print(x)
f()
print(x)
$ interpreted asd.py
11
10
This should throw UnboundLocalError
instead.
Activity