def callable(obj):
    """Return whether the object is callable (i.e., some kind of function).
       Note that classes are callable, as are instances with a __call__()
       method.
    """
    return hasattr(obj, '__call__')
