Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions Lib/calendar.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ class Day(IntEnum):
SUNDAY = 6



# Number of days per month (except for February in leap years)
mdays = [0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]

Expand Down Expand Up @@ -143,7 +142,7 @@ def weekday(year, month, day):
"""Return weekday (0-6 ~ Mon-Sun) for year, month (1-12), day (1-31)."""
if not datetime.MINYEAR <= year <= datetime.MAXYEAR:
year = 2000 + year % 400
return datetime.date(year, month, day).weekday()
return Day(datetime.date(year, month, day).weekday())


def monthrange(year, month):
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Update the return type of ``weekday`` to the newly added Day attribute