Function Details: id

Description


Returns the identity of an object.


Extended Description


The id() function returns an integer representing the identity of an object. This 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.


Read More about id from Python Documentation

Function Signature


id(object: Any) -> int

Module: builtins

Parameters



Parameter List


  • object: Any

Return


Returns an integer representing the unique identity of the object.


Return Type


int

Output

Explanation

This example shows how id() returns different values for different objects.