Path 1: 9 calls (0.64)

2004 (8) 9999 (1)

12 (2) 1 (1) 4 (1) 5 (1) 6 (1) 7 (1) 8 (1) 9 (1)

(2004, 4, 26) (2) (2004, 4, 27) (2) (2004, 4, 28) (2) (2004, 4, 29) (2) (2004, 4, 30) (2) (2004, 5, 1) (2) (2004, 5, 2) (2) (2004, 5, 31) (2) (2004, 6...

1def itermonthdays3(self, year, month):
2        """
3        Like itermonthdates(), but will yield (year, month, day) tuples.  Can be
4        used for dates outside of datetime.date range.
5        """
6        day1, ndays = monthrange(year, month)
7        days_before = (day1 - self.firstweekday) % 7
8        days_after = (self.firstweekday - day1 - ndays) % 7
9        y, m = _prevmonth(year, month)
10        end = _monthlen(y, m) + 1
11        for d in range(end-days_before, end):
12            yield y, m, d
13        for d in range(1, ndays + 1):
14            yield year, month, d
15        y, m = _nextmonth(year, month)
16        for d in range(1, days_after + 1):
17            yield y, m, d
            

Path 2: 2 calls (0.14)

2004 (2)

2 (1) 10 (1)

(2004, 1, 26) (1) (2004, 1, 27) (1) (2004, 1, 28) (1) (2004, 1, 29) (1) (2004, 1, 30) (1) (2004, 1, 31) (1) (2004, 2, 1) (1) (2004, 2, 2) (1) (2004, 2...

1def itermonthdays3(self, year, month):
2        """
3        Like itermonthdates(), but will yield (year, month, day) tuples.  Can be
4        used for dates outside of datetime.date range.
5        """
6        day1, ndays = monthrange(year, month)
7        days_before = (day1 - self.firstweekday) % 7
8        days_after = (self.firstweekday - day1 - ndays) % 7
9        y, m = _prevmonth(year, month)
10        end = _monthlen(y, m) + 1
11        for d in range(end-days_before, end):
12            yield y, m, d
13        for d in range(1, ndays + 1):
14            yield year, month, d
15        y, m = _nextmonth(year, month)
16        for d in range(1, days_after + 1):
17            yield y, m, d
            

Path 3: 2 calls (0.14)

2004 (2)

3 (1) 11 (1)

(2004, 3, 1) (1) (2004, 3, 2) (1) (2004, 3, 3) (1) (2004, 3, 4) (1) (2004, 3, 5) (1) (2004, 3, 6) (1) (2004, 3, 7) (1) (2004, 3, 8) (1) (2004, 3, 9) (...

1def itermonthdays3(self, year, month):
2        """
3        Like itermonthdates(), but will yield (year, month, day) tuples.  Can be
4        used for dates outside of datetime.date range.
5        """
6        day1, ndays = monthrange(year, month)
7        days_before = (day1 - self.firstweekday) % 7
8        days_after = (self.firstweekday - day1 - ndays) % 7
9        y, m = _prevmonth(year, month)
10        end = _monthlen(y, m) + 1
11        for d in range(end-days_before, end):
12            yield y, m, d
13        for d in range(1, ndays + 1):
14            yield year, month, d
15        y, m = _nextmonth(year, month)
16        for d in range(1, days_after + 1):
17            yield y, m, d
            

Path 4: 1 calls (0.07)

2001 (1)

2 (1)

(2001, 2, 1) (1) (2001, 2, 2) (1) (2001, 2, 3) (1) (2001, 2, 4) (1) (2001, 2, 5) (1) (2001, 2, 6) (1) (2001, 2, 7) (1) (2001, 2, 8) (1) (2001, 2, 9) (...

1def itermonthdays3(self, year, month):
2        """
3        Like itermonthdates(), but will yield (year, month, day) tuples.  Can be
4        used for dates outside of datetime.date range.
5        """
6        day1, ndays = monthrange(year, month)
7        days_before = (day1 - self.firstweekday) % 7
8        days_after = (self.firstweekday - day1 - ndays) % 7
9        y, m = _prevmonth(year, month)
10        end = _monthlen(y, m) + 1
11        for d in range(end-days_before, end):
12            yield y, m, d
13        for d in range(1, ndays + 1):
14            yield year, month, d
15        y, m = _nextmonth(year, month)
16        for d in range(1, days_after + 1):
17            yield y, m, d