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

Function _is_leap

Lib/_pydatetime.py:47–49  ·  view source on GitHub ↗

year -> 1 if leap year, else 0.

(year)

Source from the content-addressed store, hash-verified

45del dbm, dim
46
47def _is_leap(year):
48 "year -> 1 if leap year, else 0."
49 return year % 4 == 0 and (year % 100 != 0 or year % 400 == 0)
50
51def _days_before_year(year):
52 "year -> number of days before January 1st of year."

Callers 4

_days_in_monthFunction · 0.85
_days_before_monthFunction · 0.85
_ord2ymdFunction · 0.85
_isoweek_to_gregorianFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…