Ensure value is a subclass of types

    >>> class Hello(object): pass
    >>> ensure_subclass(Hello, Hello)
    >>> ensure_subclass(object, Hello)
    Traceback (most recent call last):
    TypeError:

def ensure_subclass(value, types):
    """
    Ensure value is a subclass of types

    >>> class Hello(object): pass
    >>> ensure_subclass(Hello, Hello)
    >>> ensure_subclass(object, Hello)
    Traceback (most recent call last):
    TypeError:
    """
    ensure_class(value)
    if not issubclass(value, types):
        raise TypeError(
            "expected subclass of {}, not {}".format(
                types, value))