MCPcopy Index your code
hub / github.com/python/cpython / monthdays2calendar

Method monthdays2calendar

Lib/calendar.py:301–309  ·  view source on GitHub ↗

Return a matrix representing a month's calendar. Each row represents a week; week entries are (day number, weekday number) tuples. Day numbers outside this month are zero.

(self, year, month)

Source from the content-addressed store, hash-verified

299 return [ dates[i:i+7] for i in range(0, len(dates), 7) ]
300
301 def monthdays2calendar(self, year, month):
302 """
303 Return a matrix representing a month's calendar.
304 Each row represents a week; week entries are
305 (day number, weekday number) tuples. Day numbers outside this month
306 are zero.
307 """
308 days = list(self.itermonthdays2(year, month))
309 return [ days[i:i+7] for i in range(0, len(days), 7) ]
310
311 def monthdayscalendar(self, year, month):
312 """

Callers 5

yeardays2calendarMethod · 0.95
formatmonthMethod · 0.80
formatmonthMethod · 0.80
formatmonthMethod · 0.80
test_formatweekMethod · 0.80

Calls 2

itermonthdays2Method · 0.95
listClass · 0.85

Tested by 1

test_formatweekMethod · 0.64