Quantcast
Viewing all articles
Browse latest Browse all 9

identifying objects, why does the returned value from id(...) change?

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  

Viewing all articles
Browse latest Browse all 9

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>