def get_mro_depth_of_method(type_, method_name):
    """
    Get the mro-depth of a method.

    This means, the index number in `type_`'s MRO of the base class that
    defines this method.
    """
    assert isinstance(method_name, str)
    mro = type_.mro()
    assert mro[0] is type_
    method = getattr(mro[0], method_name)
    assert method is not None
    for deepest_index, base_class in reversed(list(enumerate(mro))):
        if hasattr(base_class, method_name) and getattr(base_class, method_name
            ) == method:
            break
    return deepest_index
