class Calendar:

    def quarters(self, start, end):
        """Generate the quarter-start dates between `start` and `end`."""
date = start
while date < end:
    yield date
date = self.next_quarter_end(date)
for date in calendar.quarters(start, end):
    if another_calendar.is_holiday(date):
        continue
Имитация C-стиля для циклов в python