At present, many learning materials such as interpretation assignment and binding, when it is a simple variable, is an assignment, when it is a composite variable, is bound.
Note: The assignment is to re-copy the variable into a new variable, with no linkage between the two variables before and after the assignment. In C language:
int a=6;
int b;
b =a;
At this point B and a are two unrelated variables, changing the value of B does not affect A;
Binding simply binds a variable to a new name, for example, in the C + + language
int a=6;
int &b=a; (here & refers to)
At this point B is an alias of a, when changing the value of B, the value of a will change;
In Python, you have the following features
1) for simple variables:
>>> a=7
>>> B=a
>>> b=6
>>> b
6
>>> A
7
For composite variables
>>> c=[1,2]
>>> D=c
>>> d[1]=7
>>> D
[1, 7]
>>> C
[1, 7]
Therefore, some people think that the simple variable is an assignment, that is, the change of B does not affect a, two variables are independent of each other, while the composite variable is binding, d changes the impact of C, both point to the same variable, is the same variable name only.
But Python is a very pure language, so understanding is very wrong.
Please see:
>>> a=7
>>> B=a
>>> ID (a)
31892112
>>> ID (b)
31892112
>>> b=4
>>> ID (b)
31892148
So when running b=4, this is because the name of B is re-bound to the variable 4, points to another variable, and a still points to the previous variable, so the two are different.
This shows that there is only binding in Python, whether it is a simple variable or a composite variable.
Pure Python bindings