Manual
Return the “identity” of an object. This is an integer which is guaranteed to be unique and constant for this object during its lifetime. Two objects with non-overlapping lifetimes may have the same id() value.
CPython implementation detail: This is the address of the object in memory.
直译
返回object的“身份”,返回值为整数,是为了确保在对象的生命周期内的独特性和一致性,两个非重叠生命周期的对象可能有相同的id()值。
CPython实现细节:该值为对象的内存地址。
实例
>>> import os
>>> id(os)
44484096
>>> def foo(x):