import builtins


def is_type(obj, type):
    """Is the object a subclass of the specified type?

    This is similar to the builtin ``issubclass`` but also ensures the
    object is a type first.

    """
    if not isinstance(obj, builtins.type):
        return False
    return issubclass(obj, type)