On this page
  1. id
  2. Import & Availability
  3. Overview & Signature
  4. Usage
  5. Gotchas
  6. REPL Inspect

id

Prev: hex | Up: __builtins__ | Next: input
Rel: callable, delattr, dir, getattr, hasattr
Ref: docs.python.org — id
Tags: #public #python3 #builtins


Import & Availability

# Built-in (available globally without import)
from builtins import id

Overview & Signature

id(obj, /)

Return the identity of an object.

Usage

a = [1, 2]
b = a
assert id(a) == id(b) and a is b

Gotchas

REPL Inspect

help(id)

Linked from

Related notes