Python callable() built-in function

From the Python 3 documentation

Return True if the object argument appears callable, False if not. If this 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); instances are callable if their class has a __call__() method.


>>> def my_function():
...     print('this is a test function')
>>> callable(my_function)
# True
>>> callable(True)
# False
>>> callable(1)
# False
>>> callable('a')
# False

Ups! Nothing here yet!

This is a great opportunity for you to collaborate! Hit the link at the end of this page and add some examples and a brief description. If you don't know where to start, the Python 3 documentation will lead you in the right direction.

Subscribe to

A two times a month and bullshit free publication, full of interesting, relevant links.