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

Function _days_in_month

Lib/_pydatetime.py:56–61  ·  view source on GitHub ↗

year, month -> number of days in that month in that year.

(year, month)

Source from the content-addressed store, hash-verified

54 return y*365 + y//4 - y//100 + y//400
55
56def _days_in_month(year, month):
57 "year, month -> number of days in that month in that year."
58 assert 1 <= month <= 12, month
59 if month == 2 and _is_leap(year):
60 return 29
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."

Callers 4

_ymd2ordFunction · 0.85
_ord2ymdFunction · 0.85
_check_date_fieldsFunction · 0.85
fromisoformatMethod · 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…