Hehe, this question is not basic at all, this is very deep! Coming from a C++ background, I asked myself the same when I learned Python, and it took me a long time to figure it out.
In Python, you never assign the value of anything, ever. You just create references.
If you do:
a = "Hello"
b = a
then Python creates a new string object “Hello”. It really is an object, you can do “Hello”.upper() for example.
But you can never change it, Python doesn’t allow you to. Python variables like a and b are simply references to the “Hello” object.
An operation like “a = b” is in principle much faster in Python than in C++, because no copy of “Hello” is ever made (the variables just point to the same object).
The C/C++ equivalent would be more or less this:
PyObject *a;
PyObject *b;
string hello_object("Hello");
a = (PyObject *) &hello_object;
b = a;
So, there is no “linkage” in Python, and changing (re-assigning) a will not change b.
It is of course different if a and b are containers (lists and dicts). You cannot assign to the containers, but you can modify their contents (the references to other Python objects they contain). So, for example:
a = [1,2,3]
b = a
a.append(4)
will have a and b point to the same list [1,2,3,4].
On the other hand,
a = [1,2,3]
b = a
a = [1,2,3,4]
will have a and b point to two different list objects.