Raises a :exc:`TypeError` if the value is not a callable.

def is_callable(instance, attribute, value):
    """Raises a :exc:`TypeError` if the value is not a callable."""

    if not callable(value):
        raise TypeError("'{}' must be callable".format(attribute.name))