discription about id()
:
Help on built-in function id in module builtins:
id(obj, /) Return the identity of an object.
This is guaranteed to be unique among simultaneously existing objects. (CPython uses the object's memory address.)
but I found a strange thing as below:
>>> id([2222]) == id([2222])
True
>>> id([2222]) == id([2223])
True
>>> id([2222]) == id([2224])
True
>>> id([2222]) == id([2225])
True
>>> id((12, 12)) == id((12, 12))
True
>>> id((12, 12)) == id((12, 13))
False
>>> id([12, 12]) == id([12, 13])
True
>>> a = [12, 12]
>>> b = [12, 13]
>>> id(a) == id(b)
False
who can explain this?