AFAIU Python's closure have been incomplete for a long time. I think they've become true, complete closures after the addition of the nonlocal keyword on 3.0
Please correct me if I'm mistaken. This all comes from a cursory research on the subject.
Please correct me if I'm mistaken. This all comes from a cursory research on the subject.
def outer ():
counter = [0]
def inner ():
counter[0] += 1
return counter[0]
return innerAlthough being able to write on the closed over variable is a neat feature to have, I would argue that feature does make a difference. Whether you call that complete or read-write or however you want to.