def overrides(method):
    '''
    Meant to be used as
    
    class B:
        @overrides(A.m1)
        def m1(self):
            pass
    '''
    def wrapper(func):
        if func.__name__ != method.__name__:
            msg = "Wrong @override: %r expected, but overwriting %r."
            msg = msg % (func.__name__, method.__name__)
            raise AssertionError(msg)

        if func.__doc__ is None:
            func.__doc__ = method.__doc__

        return func

    return wrapper

    Meant to be used as
    
    class B:
        @overrides(A.m1)
        def m1(self):
            pass
    
debugger/src/_pydev_bundle/pydev_override.py