why does python not believe in variable scoping, but then complain about it?