def require(inst, owner, name, *parents):
    """Raises a (nicely explained) type error if owner is not a subclass of all parents.

    It is useful when making sure that a certain type of property is only used within
    certain classes.

    Parameters
    ----------
    inst
        instance of a property object or method.
    owner : type
        class of an object.
    name : str
        name of the attribute to which the property object is assigned.
    parents : iterable of type
        classes that owner must inherit.

    Raises
    ------
    TypeError
        If owner does not inherit from all parents.

    """
    for parent in parents:
        if not issubclass(owner, parent):
            raise TypeError(
                '%r is a %r but %r is not a subclass from %r as required' %
                (name, inst.__class__.__name__, owner.__name__, parent.
                __name__))
