Given following code:
def A() : b = 1 def B() : # I can access \'b\' from here. print( b ) # But can i modify \'b\' here? \'
For anyone looking at this much later on a safer but heavier workaround is. Without a need to pass variables as parameters.
def outer(): a = [1] def inner(a=a): a[0] += 1 inner() return a[0]