callable(object)
Parameters
callable()takes a single object as an argument.
Return Value
- Returns
Trueif the object is callable; otherwise, it returnsFalse.
Examples
callable(sum) # True
callable(int) # True
callable(1) # False
Classes are callable, and calling a class creates an instance. Class instances are callable if the class defines the __call__ method.
The function was removed in version 3.0 and reintroduced in version 3.2.