def Instance(expected, message="Not an instance of {}"):
    """
    Creates a validator that checks if the given value is an instance of
    ``expected``.

    A custom message can be specified with ``message``.
    """
    @wraps(Instance)
    def built(value):
        if not isinstance(value, expected):
            raise Error(message.format(expected.__name__))
        return value
    return built