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

Function monthrange

Lib/calendar.py:167–173  ·  view source on GitHub ↗

Return weekday of first day of month (0-6 ~ Mon-Sun) and number of days (28-31) for year, month.

(year, month)

Source from the content-addressed store, hash-verified

165 raise IllegalMonthError(month)
166
167def monthrange(year, month):
168 """Return weekday of first day of month (0-6 ~ Mon-Sun)
169 and number of days (28-31) for year, month."""
170 _validate_month(month)
171 day1 = weekday(year, month, 1)
172 ndays = mdays[month] + (month == FEBRUARY and isleap(year))
173 return day1, ndays
174
175
176def _monthlen(year, month):

Callers 2

itermonthdaysMethod · 0.85
itermonthdays3Method · 0.85

Calls 3

_validate_monthFunction · 0.85
weekdayFunction · 0.85
isleapFunction · 0.85

Tested by

no test coverage detected