def __add__(self, other):
        if isinstance(other, MonthDelta):
            return MonthDelta(self.__months + other.months)
        if isinstance(other, date):
            day = other.day
            # subract one because months are not zero-based
            month = other.month + self.__months - 1
            year = other.year + month // 12
            # now add it back
            month = month % 12 + 1
            if month == 2:
                if day >= 29 and not year%4 and (year%100 or not year%400):
                    day = 29
                elif day > 28:
                    day = 28
            elif month in (4, 6, 9, 11) and day > 30:
                day = 30
            try:
                return other.replace(year, month, day)
            except __HOLE__:
                raise OverflowError('date value out of range')
        return NotImplemented
dataset/ETHPy150Open zulip/zulip/tools/deprecated/finbot/monthdelta.py/MonthDelta.__add__