just aliases for the same memory
You misunderstood how βvariablesβ work in python. Variables - this cell is not . These are just names attached to objects. When you do the assignment:
i = 0
you specify a name for the inew object 0in the current area.
You should read the naming and binding documentation.
, :
i:
foo.i i
| /
| /
| /
| /
| /
| /
| /
+-----+
| 999 |
+-----+
999 . :
i = 0
:
foo.i i
| |
| |
| |
| |
| |
| |
| |
+-----+ +---+
| 999 | | 0 |
+-----+ +---+
999... : , python .
, :
i = 999
j = i
i = 0
print(i, j)
i j - . C, python . :
int *i = &999;
int *j = i;
i = &0;
printf("%d %d", *i, *j);