MCPcopy Index your code
hub / github.com/RustPython/RustPython / monthdays2calendar

Method monthdays2calendar

Lib/calendar.py:282–290  ·  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

280 return [ dates[i:i+7] for i in range(0, len(dates), 7) ]
281
282 def monthdays2calendar(self, year, month):
283 """
284 Return a matrix representing a month's calendar.
285 Each row represents a week; week entries are
286 (day number, weekday number) tuples. Day numbers outside this month
287 are zero.
288 """
289 days = list(self.itermonthdays2(year, month))
290 return [ days[i:i+7] for i in range(0, len(days), 7) ]
291
292 def monthdayscalendar(self, year, month):
293 """

Callers 5

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

Calls 3

itermonthdays2Method · 0.95
listClass · 0.85
lenFunction · 0.85

Tested by 1

test_formatweekMethod · 0.64