March 2003
Intermediate to advanced
656 pages
39h 30m
English
id
id(obj)Returns the integer value that denotes the identity of
obj. The id of
obj is unique and constant during
obj’s lifetime, but may
be reused at any later time after obj is
garbage-collected. When a type or class does not define equality
comparison, Python uses id to compare and hash
instances. For any objects x and
y, the identity check
x
is
y has the same result as
id(
x
)==id(
y
).
Read now
Unlock full access