callable()

Built-in FunctionPython 2.0+Intermediate

Returns True if the object appears callable (has __call__)

Quick Info

Documentation
Official Docs
Python Version
2.0+

Learn by Difficulty

Quick Example

python
print(callable(print))
print(callable(42))
print(callable(lambda x: x))

class Adder:
    def __call__(self, x): return x + 1

print(callable(Adder()))

callable() is a built-in function that returns true if the object appears callable (has __call__).

Try in Playground

Tags

builtinfunctioncore