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

Function _days_before_month

Lib/_pydatetime.py:63–66  ·  view source on GitHub ↗

year, month -> number of days in year preceding first day of month.

(year, month)

Source from the content-addressed store, hash-verified

61 return _DAYS_IN_MONTH[month]
62
63def _days_before_month(year, month):
64 "year, month -> number of days in year preceding first day of month."
65 assert 1 <= month <= 12, f"month must be in 1..12, not {month}"
66 return _DAYS_BEFORE_MONTH[month] + (month > 2 and _is_leap(year))
67
68def _ymd2ord(year, month, day):
69 "year, month, day -> ordinal, considering 01-Jan-0001 as day 1."

Callers 2

_ymd2ordFunction · 0.85
_build_struct_timeFunction · 0.85

Calls 1

_is_leapFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…