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

callable

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


Import & Availability

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

Overview & Signature

callable(obj, /)

Return whether the object is callable (i.e., some kind of function).

Usage

assert callable(len) is True
assert callable(dict) is True   # classes are callable
assert callable(42) is False

Gotchas

REPL Inspect

help(callable)

Linked from

Related notes