Перейти к содержанию

Python id() built-in function

Python id() built-in function

From the Python 3 documentation 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.

Examples

>>> id(1)
# 9788960
>>> id('1')
# 140269689726000
>>> id([1, 2])
# 140269672924928