def f2(): stash.y = 2 print(stash.y) try: stash.x except AttributeError: print("x is not local to f2")