Driver FixRecommendedSound, Wi-Fi or graphics acting up? Check drivers firstFind missing or outdated drivers fast.Check DriversOctober DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsClean PCRecommendedOne scan can reveal what keeps slowing WindowsLook for cleanup and repair opportunities.Run Scan×
Skip to content
World desk1 min

Python callable(): Check Whether an Object Can Be Called

Python’s callable() checks whether an object appears callable, but it cannot guarantee that a specific call will succeed. See examples with functions, classes, and instances.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Python’s built-in callable(obj) returns True when an object appears to support call syntax, such as obj(...), and False when it does not. A True result does not guarantee that a particular call will succeed.

How to check whether an object is callable

Pass the object as the single positional-only argument to callable():

As an Amazon Associate I earn from qualifying purchases.

callable(object, /)

Functions and classes are callable. An instance is callable if its class defines __call__(). This example shows the difference:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
def greet(name):
    return f"Hello, {name}"

class Greeter:
    def __call__(self, name):
        return f"Hello, {name}"

class User:
    pass

print(callable(greet))       # True: function
print(callable(Greeter))     # True: class
print(callable(Greeter()))   # True: instance defines __call__
print(callable(User()))      # False: no __call__ method

A class is callable because calling it creates an instance. An instance is callable when its class supplies __call__(). See Python’s built-in function documentation.

Why callable() can return True even when a call fails

callable() checks whether an object appears callable; it does not check whether a particular argument list is valid or whether execution will complete successfully. For example, callable(greet) is True, but greet() raises an error because the function requires a name argument. A call may also fail because of the function’s behavior at runtime.

Use callable(obj) as a quick predicate, not as a guarantee that obj(*args, **kwargs) will work. Attempting the actual call checks that particular invocation, but it may execute code and raise an exception.

callable() versus Callable type annotations

callable(obj) is a runtime check. collections.abc.Callable is used in type annotations to describe callable parameters and return types. When a callable’s signature is complex, a Protocol that defines __call__() can express it more precisely. See Python’s typing documentation.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Python version notes

callable() was removed in Python 3.0 and restored in Python 3.2, so that historical change does not affect current versions. The current Python 3.14 documentation lists its signature as callable(object, /). Python 3.12 documentation also notes that static methods became callable as regular functions in Python 3.10. See the built-in function documentation and Python 3.12 documentation.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
PC Slower Than It Used to Be?Free scan - under a minute
Crashes, No Sound, or Screen Glitches?Free driver scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.