Calculate implicit dates
elif self.month is None:
            day = self.day
            month = future_date.month
            year = future_date.year
            date = datetime.date(year, month, day)
            if date &lt; future_date:
                return date
            else:
                month = future_date.month - 1
                if month == 0:
                    month = 12
                    year = future_date.year - 1
                date = datetime.date(year, month, day)
                return date ```



This can be simplified to:

if len(a_date) &gt; 1:
            if (curr_month and a_date[1] &gt; curr_month):
                curr_year -= 1
            curr_month = a_date[1]


Also,


        elif self.year is None:
            day = self.day
            month = self.month
            year = future_date.year
            date = datetime.date(year, month, day)
            if date &lt; future_date:
                return date
            else:
                year = future_date.year - 1
                date = datetime.date(year, month, day)
                return date ```



Can now use a shared statement such as:

if len(a_date) &gt; 1:
            if (curr_month and a_date[1] &gt; curr_month):
                curr_year -= 1
            curr_month = a_date[1]
        if len(a_date) &gt; 2:
            curr_year = a_date[2]


Then,


if self.year is None or self.month is None or self.day is None



Can be simplified using the any() operator which checks a list of items against a condition (in this case if they are not None) then returns true/false depending on if all items satisfied the condition.


day = self.day
            month = future_date.month
            year = future_date.year
            date = datetime.date(year, month, day)



I would turn this into a function as it is repeated again.

The final code after condensing the logic is:

def implicit_dates(history):
    computed_dates = []
    curr_day = None
    curr_month = None
    curr_year = None
    history = reversed(history)
    for a_date in history:
        curr_day = a_date[0]    
        if len(a_date) &gt; 1:
            if (curr_month and a_date[1] &gt; curr_month):
                curr_year -= 1
            curr_month = a_date[1]
        if len(a_date) &gt; 2:
            curr_year = a_date[2]
        if (curr_day and curr_month and curr_year):
            computed_dates.append(
                datetime.datetime(curr_year, curr_month, curr_day))
    return reversed(computed_dates)


for historical_date in implicit_dates(history):
    print(historical_date.strftime("%Y-%m-%d"))