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

Function monthrange

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

184 raise IllegalMonthError(month)
185
186def monthrange(year, month):
187 """Return weekday of first day of month (0-6 ~ Mon-Sun)
188 and number of days (28-31) for year, month."""
189 _validate_month(month)
190 day1 = weekday(year, month, 1)
191 ndays = mdays[month] + (month == FEBRUARY and isleap(year))
192 return day1, ndays
193
194
195def _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

Used in the wild real call sites across dependent graphs

searching dependent graphs…