Skip to content
masterclassBuddyTech Buzz5 fresh blogs · 5:00 AM IST

Python · Function

callable

Tests whether an object appears callable. Classes, functions, and instances with __call__() can return True, but a True result does not guarantee that invocation will succeed.

Since
3.2

How it works

callable() tests whether an object appears usable with call syntax. Functions and classes qualify, as do instances whose class defines __call__; a positive result does not guarantee that invoking the object will succeed.

Syntax

callable(object, /)

Parameters

NameTypeDescription
objectobjectThe object to test for apparent callability.

Returns

True if object appears callable; otherwise False.

Key points

  • The function returns a Boolean indicating whether its argument appears callable.
  • Classes are callable because invoking one creates an instance.
  • An instance can be called when its class implements __call__().
  • callable() was added in Python 3.2 after being absent in Python 3.0.

Common mistakes

  • True is only an indication that the object appears callable; calling it can still raise an exception.
  • A False result rules out successfully calling the object.

Example: Checking callable objects

def greet(name):
    return f"Hello, {name}"

class Greeter:
    def __call__(self, name):
        return greet(name)

for item in (greet, Greeter(), 42):
    print(callable(item))

Checks whether a function, an instance with __call__, or an integer can be invoked.

When to use it

Callback validation

Validate a callback before passing it to another function.

Strategy objects

Distinguish callable strategy objects from ordinary values.

Dynamic invocation

Check dynamically obtained attributes before invoking them.

  • __call__
  • iter

Source: Built-in functions. Checked 2026-10-15.