While reading the book Introduction to Computer Science with Python, Charles Dierbach, I asked a question:
- On page 210 he says: βA link is a value that refers or points to the location of another object. The value of a variable reference can be determined using the built-in function identifier.β
So, a link is just an address in the memory of an object.
Now, if I am not mistaken, when I create a variable of the type:
>>> a = 3
The name a is automatically placed by Python in the namespace .
If I do this:
>>> id(a) 4548344816
I get the address in memory of object 3 , which refers to a .
So, I want to know how the name a and the reference value are related.
I assume that when a name is placed in a namespace, it includes 2 things:
A pair, for example, could be: a:reference value ?
If so, is there any instrospection tool to see what the namespace entry looks like?
source share