def func(): def local(): x = True def nested(): nonlocal x x = False