Python Names
Python doesn’t have variables, instead they have names. There is no concept of variables in Python.
Note
The notion we have of a variable is something which stores value and it can be changed through out the program life cycle. There can be different implementation of in different programming languages. For instance in C, a variable owns a memory location and stores a value in it. If a new value is reassigned, the memory location remains the same but the value is overwritten on the same location.
Understanding Names
Considering the following statement,
a = 1Following things happen when this statement executes.
- A
PyObjectis created. This PyObject can’t be accessed by user program. It is internal to CPython implementation. typecodeis set as integer.valueis set as 1.refcount is increased by 1.- name is
ais bounded to thisPyObject.

Tip
sys.getrefcountmethod returns reference count to aPyObject.