From fa9f015ac0fc18198893bec99fc13b352c818fed Mon Sep 17 00:00:00 2001 From: Terry Jan Reedy Date: Sun, 16 Jun 2024 00:17:27 -0400 Subject: [PATCH 1/2] gh-120567: Clarify calendar.monthrange weekday return --- Lib/calendar.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Lib/calendar.py b/Lib/calendar.py index 833ce331b14a0c..487eabf0574ac6 100644 --- a/Lib/calendar.py +++ b/Lib/calendar.py @@ -159,8 +159,8 @@ def weekday(year, month, day): def monthrange(year, month): - """Return weekday (0-6 ~ Mon-Sun) and number of days (28-31) for - year, month.""" + """Return day 1 weekday (0-6 ~ Mon-Sun) and number of days (28-31) + for year, month.""" if not 1 <= month <= 12: raise IllegalMonthError(month) day1 = weekday(year, month, 1) From 7da65465e288e4072248ffa835e9fe90f64ed57a Mon Sep 17 00:00:00 2001 From: Terry Jan Reedy Date: Sun, 16 Jun 2024 16:03:50 -0400 Subject: [PATCH 2/2] Update Lib/calendar.py Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com> --- Lib/calendar.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Lib/calendar.py b/Lib/calendar.py index 487eabf0574ac6..069dd5174112ae 100644 --- a/Lib/calendar.py +++ b/Lib/calendar.py @@ -159,8 +159,8 @@ def weekday(year, month, day): def monthrange(year, month): - """Return day 1 weekday (0-6 ~ Mon-Sun) and number of days (28-31) - for year, month.""" + """Return weekday of first day of month (0-6 ~ Mon-Sun) + and number of days (28-31) for year, month.""" if not 1 <= month <= 12: raise IllegalMonthError(month) day1 = weekday(year, month, 1)