英文文件:
id(object)
Return the “identity” of an object. This is an integer which is guaranteed to be unique and constant for this object slife slifeseal ). may have the sameid() value.
CPython implementation detail: This is the address of the object in memory.
.
.在程式生命週期內,這個識別符常數是唯一的。
>>> a = 1 >>> id(a) >>> id(1.0) >>> a = 'some text' >>> id(a)