id(object)
This is an integer (or long integer) which is guaranteed to be unique and constant for this object during its lifetime.
Can you explain this output? Why does j
's id change?
>>> i=10 >>> id(i) 6337824 >>> j=10 >>> id(j) 6337824 >>> j=j+1 >>> id(j) 6337800 >>> id(i) 6337824