Returns a Boolean stating whether the object argument appears callable.
- Required. Any valid object.
If callable() returns True, it is still possible that a call fails, but if it is False, calling object will never succeed. Note that classes are callable (calling a class returns a new instance); class instances are callable if they have a __call__() method.
>>> def bar(): pass ... >>> callable(bar) True >>> class foo: pass ... >>> callable(foo) True >>> callable(10) False >>> callable('hello') False >>> callable(True) False