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

Function _isoweek1monday

Lib/_pydatetime.py:2433–2441  ·  view source on GitHub ↗
(year)

Source from the content-addressed store, hash-verified

2431
2432
2433def _isoweek1monday(year):
2434 # Helper to calculate the day number of the Monday starting week 1
2435 THURSDAY = 3
2436 firstday = _ymd2ord(year, 1, 1)
2437 firstweekday = (firstday + 6) % 7 # See weekday() above
2438 week1monday = firstday - firstweekday
2439 if firstweekday > THURSDAY:
2440 week1monday += 7
2441 return week1monday
2442
2443
2444class timezone(tzinfo):

Callers 2

_isoweek_to_gregorianFunction · 0.85
isocalendarMethod · 0.85

Calls 1

_ymd2ordFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…