Binding Occurrence
suggest changex = 5
x += 7
for x in iterable: pass
Each of the above statements is a binding occurrence. x = 5 binds x to 5. x += 7 binds x to the result of the addition. for x in iterable binds x to each element. If a binding statement appears inside a function, then x is function-local by default. See the “Syntax” section of Variable Scope and Binding for a list of binding statements.
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents