From 639845d3ddf56f8a13e806bbb54cb31b0c57fc32 Mon Sep 17 00:00:00 2001 From: Mat Scull Date: Thu, 29 Aug 2024 23:47:12 +0100 Subject: [PATCH 1/8] Update Doc/library/calendar.rst to fix 123445 --- Doc/library/calendar.rst | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Doc/library/calendar.rst b/Doc/library/calendar.rst index d5876054da3eee..e01b0552086813 100644 --- a/Doc/library/calendar.rst +++ b/Doc/library/calendar.rst @@ -393,12 +393,12 @@ The :mod:`calendar` module exports the following data attributes: .. data:: day_name - An array that represents the days of the week in the current locale. + A sequence that represents the days of the week in the current locale. .. data:: day_abbr - An array that represents the abbreviated days of the week in the current locale. + A sequence that represents the abbreviated days of the week in the current locale. .. data:: MONDAY @@ -426,14 +426,14 @@ The :mod:`calendar` module exports the following data attributes: .. data:: month_name - An array that represents the months of the year in the current locale. This + A sequence that represents the months of the year in the current locale. This follows normal convention of January being month number 1, so it has a length of 13 and ``month_name[0]`` is the empty string. .. data:: month_abbr - An array that represents the abbreviated months of the year in the current + A sequence that represents the abbreviated months of the year in the current locale. This follows normal convention of January being month number 1, so it has a length of 13 and ``month_abbr[0]`` is the empty string. From 5197bf657c23a6ba5fd2b502d6b311bc9559819e Mon Sep 17 00:00:00 2001 From: Mat Scull Date: Fri, 30 Aug 2024 23:06:50 +0100 Subject: [PATCH 2/8] Improve explanation of day_name, day_abbr, month_name and month_abbr. --- Doc/library/.#collections.rst | 1 + Doc/library/calendar.rst | 48 +++++++++++++---------------------- 2 files changed, 19 insertions(+), 30 deletions(-) create mode 120000 Doc/library/.#collections.rst diff --git a/Doc/library/.#collections.rst b/Doc/library/.#collections.rst new file mode 120000 index 00000000000000..be628170f962dc --- /dev/null +++ b/Doc/library/.#collections.rst @@ -0,0 +1 @@ +mat@here.16268 \ No newline at end of file diff --git a/Doc/library/calendar.rst b/Doc/library/calendar.rst index e01b0552086813..7096c435fe1864 100644 --- a/Doc/library/calendar.rst +++ b/Doc/library/calendar.rst @@ -394,23 +394,21 @@ The :mod:`calendar` module exports the following data attributes: .. data:: day_name A sequence that represents the days of the week in the current locale. - + + >>> import calendar + >>> list(calendar.day_name) + ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday'] .. data:: day_abbr - A sequence that represents the abbreviated days of the week in the current locale. + A sequence that represents the abbreviated days of the week in + the current locale where ``MONDAY`` is ``0`` and ``SUNDAY`` is ``6``. + + >>> list(calendar.day_abbr) + ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'] -.. data:: MONDAY - TUESDAY - WEDNESDAY - THURSDAY - FRIDAY - SATURDAY - SUNDAY - Aliases for the days of the week, - where ``MONDAY`` is ``0`` and ``SUNDAY`` is ``6``. .. versionadded:: 3.12 @@ -430,29 +428,19 @@ The :mod:`calendar` module exports the following data attributes: follows normal convention of January being month number 1, so it has a length of 13 and ``month_name[0]`` is the empty string. + >>> list(calendar.month_name) + ['', 'January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'] + .. data:: month_abbr A sequence that represents the abbreviated months of the year in the current - locale. This follows normal convention of January being month number 1, so it - has a length of 13 and ``month_abbr[0]`` is the empty string. - - -.. data:: JANUARY - FEBRUARY - MARCH - APRIL - MAY - JUNE - JULY - AUGUST - SEPTEMBER - OCTOBER - NOVEMBER - DECEMBER - - Aliases for the months of the year, - where ``JANUARY`` is ``1`` and ``DECEMBER`` is ``12``. + locale where ``JANUARY`` is ``1`` and ``DECEMBER`` is ``12``.. This follows + normal convention of January being month number 1, so it has a length of 13 + and ``month_abbr[0]`` is the empty string. + + >>> list(calendar.month_abbr) + ['', 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'] .. versionadded:: 3.12 From da3826ccba8337f7766e7db0312b8c126c0f5e7a Mon Sep 17 00:00:00 2001 From: Mat Scull Date: Fri, 30 Aug 2024 23:13:41 +0100 Subject: [PATCH 3/8] Correct line lengths --- Doc/library/calendar.rst | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/Doc/library/calendar.rst b/Doc/library/calendar.rst index 7096c435fe1864..2605a82c374371 100644 --- a/Doc/library/calendar.rst +++ b/Doc/library/calendar.rst @@ -397,7 +397,8 @@ The :mod:`calendar` module exports the following data attributes: >>> import calendar >>> list(calendar.day_name) - ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday'] + ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', + 'Sunday'] .. data:: day_abbr @@ -424,20 +425,23 @@ The :mod:`calendar` module exports the following data attributes: .. data:: month_name - A sequence that represents the months of the year in the current locale. This - follows normal convention of January being month number 1, so it has a length of - 13 and ``month_name[0]`` is the empty string. + A sequence that represents the months of the year in the current + locale. This follows normal convention of January being month + number 1, so it has a length of 13 and ``month_name[0]`` is the + empty string. >>> list(calendar.month_name) - ['', 'January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'] + ['', 'January', 'February', 'March', 'April', 'May', 'June', + 'July', 'August', 'September', 'October', 'November', 'December'] .. data:: month_abbr - A sequence that represents the abbreviated months of the year in the current - locale where ``JANUARY`` is ``1`` and ``DECEMBER`` is ``12``.. This follows - normal convention of January being month number 1, so it has a length of 13 - and ``month_abbr[0]`` is the empty string. + A sequence that represents the abbreviated months of the year in the + current locale where ``JANUARY`` is ``1`` and ``DECEMBER`` is + ``12``. This follows normal convention of January being month + number 1, so it has a length of 13 and ``month_abbr[0]`` is the + empty string. >>> list(calendar.month_abbr) ['', 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'] From 6cd1db33ee8d98cd3ecb1bbf749201dcd1aeea33 Mon Sep 17 00:00:00 2001 From: Mat Scull Date: Fri, 30 Aug 2024 23:21:01 +0100 Subject: [PATCH 4/8] pythongh-123445: Update and clarify day_name, day_abbr, month_name and month_abbr --- Doc/library/calendar.rst | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/Doc/library/calendar.rst b/Doc/library/calendar.rst index 2605a82c374371..d862b14991e960 100644 --- a/Doc/library/calendar.rst +++ b/Doc/library/calendar.rst @@ -393,17 +393,20 @@ The :mod:`calendar` module exports the following data attributes: .. data:: day_name - A sequence that represents the days of the week in the current locale. + A sequence that represents the days of the week in the current + where ```Monday``` is ```0``` and ```Sunday``` is ```6``` in the + current locale. >>> import calendar >>> list(calendar.day_name) ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday'] + .. data:: day_abbr A sequence that represents the abbreviated days of the week in - the current locale where ``MONDAY`` is ``0`` and ``SUNDAY`` is ``6``. + the current locale where ``Mon`` is ``0`` and ``Sun`` is ``6``. >>> list(calendar.day_abbr) @@ -438,10 +441,9 @@ The :mod:`calendar` module exports the following data attributes: .. data:: month_abbr A sequence that represents the abbreviated months of the year in the - current locale where ``JANUARY`` is ``1`` and ``DECEMBER`` is - ``12``. This follows normal convention of January being month - number 1, so it has a length of 13 and ``month_abbr[0]`` is the - empty string. + current locale where ``Jan`` is ``1`` and ``Dec`` is ``12``. This + follows normal convention of January being month number 1, so it has + a length of 13 and ``month_abbr[0]`` is the empty string. >>> list(calendar.month_abbr) ['', 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'] From d7a41eeb31ca64f8502be46d8a59a6c081d04cbf Mon Sep 17 00:00:00 2001 From: Mat Scull Date: Fri, 30 Aug 2024 23:23:19 +0100 Subject: [PATCH 5/8] pythongh-123445: Update and clarify day_name, day_abbr, month_name and month_abbr --- Doc/library/calendar.rst | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Doc/library/calendar.rst b/Doc/library/calendar.rst index d862b14991e960..9dbdde23cdd84b 100644 --- a/Doc/library/calendar.rst +++ b/Doc/library/calendar.rst @@ -446,7 +446,8 @@ The :mod:`calendar` module exports the following data attributes: a length of 13 and ``month_abbr[0]`` is the empty string. >>> list(calendar.month_abbr) - ['', 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'] + ['', 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', + 'Sep', 'Oct', 'Nov', 'Dec'] .. versionadded:: 3.12 From 8de51a70963e0110bf46a2ac487afa9e723e236e Mon Sep 17 00:00:00 2001 From: Adam Turner <9087854+aa-turner@users.noreply.github.com> Date: Sat, 31 Aug 2024 02:03:14 -0500 Subject: [PATCH 6/8] Fix whitespace, reduce wording change, remove random file --- Doc/library/.#collections.rst | 1 - Doc/library/calendar.rst | 79 ++++++++++++++++++++++------------- 2 files changed, 51 insertions(+), 29 deletions(-) delete mode 120000 Doc/library/.#collections.rst diff --git a/Doc/library/.#collections.rst b/Doc/library/.#collections.rst deleted file mode 120000 index be628170f962dc..00000000000000 --- a/Doc/library/.#collections.rst +++ /dev/null @@ -1 +0,0 @@ -mat@here.16268 \ No newline at end of file diff --git a/Doc/library/calendar.rst b/Doc/library/calendar.rst index 9dbdde23cdd84b..bf42582860ce84 100644 --- a/Doc/library/calendar.rst +++ b/Doc/library/calendar.rst @@ -393,26 +393,33 @@ The :mod:`calendar` module exports the following data attributes: .. data:: day_name - A sequence that represents the days of the week in the current - where ```Monday``` is ```0``` and ```Sunday``` is ```6``` in the - current locale. - - >>> import calendar - >>> list(calendar.day_name) - ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', - 'Sunday'] + A sequence that represents the days of the week in the current locale, + where ``Monday`` is ``0`` and ``Sunday`` is ``6``. + >>> import calendar + >>> list(calendar.day_name) + ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday'] -.. data:: day_abbr - A sequence that represents the abbreviated days of the week in - the current locale where ``Mon`` is ``0`` and ``Sun`` is ``6``. +.. data:: day_abbr + A sequence that represents the abbreviated days of the week in the current locale, + where ``Mon`` is ``0`` and ``Sun`` is ``6``. - >>> list(calendar.day_abbr) - ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'] + >>> import calendar + >>> list(calendar.day_abbr) + ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'] +.. data:: MONDAY + TUESDAY + WEDNESDAY + THURSDAY + FRIDAY + SATURDAY + SUNDAY + Aliases for the days of the week, + where ``MONDAY`` is ``0`` and ``SUNDAY`` is ``6``. .. versionadded:: 3.12 @@ -428,26 +435,42 @@ The :mod:`calendar` module exports the following data attributes: .. data:: month_name - A sequence that represents the months of the year in the current - locale. This follows normal convention of January being month - number 1, so it has a length of 13 and ``month_name[0]`` is the - empty string. + A sequence that represents the months of the year in the current locale. This + follows normal convention of January being month number 1, so it has a length of + 13 and ``month_name[0]`` is the empty string. - >>> list(calendar.month_name) - ['', 'January', 'February', 'March', 'April', 'May', 'June', - 'July', 'August', 'September', 'October', 'November', 'December'] + >>> import calendar + >>> list(calendar.month_name) + ['', 'January', 'February', 'March', 'April', 'May', 'June', + 'July', 'August', 'September', 'October', 'November', 'December'] .. data:: month_abbr - A sequence that represents the abbreviated months of the year in the - current locale where ``Jan`` is ``1`` and ``Dec`` is ``12``. This - follows normal convention of January being month number 1, so it has - a length of 13 and ``month_abbr[0]`` is the empty string. - - >>> list(calendar.month_abbr) - ['', 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', - 'Sep', 'Oct', 'Nov', 'Dec'] + A sequence that represents the abbreviated months of the year in the current + locale. This follows normal convention of January being month number 1, so it + has a length of 13 and ``month_abbr[0]`` is the empty string. + + >>> import calendar + >>> list(calendar.month_abbr) + ['', 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', + 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'] + +.. data:: JANUARY + FEBRUARY + MARCH + APRIL + MAY + JUNE + JULY + AUGUST + SEPTEMBER + OCTOBER + NOVEMBER + DECEMBER + + Aliases for the months of the year, + where ``JANUARY`` is ``1`` and ``DECEMBER`` is ``12``. .. versionadded:: 3.12 From e29f5fe056ac60e487828984bb7e1c59f7318747 Mon Sep 17 00:00:00 2001 From: "Eric V. Smith" Date: Tue, 24 Sep 2024 17:16:01 -0400 Subject: [PATCH 7/8] Apply suggestions from code review These look good to me. Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com> --- Doc/library/calendar.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Doc/library/calendar.rst b/Doc/library/calendar.rst index bf42582860ce84..f44de699c8bb8f 100644 --- a/Doc/library/calendar.rst +++ b/Doc/library/calendar.rst @@ -394,7 +394,7 @@ The :mod:`calendar` module exports the following data attributes: .. data:: day_name A sequence that represents the days of the week in the current locale, - where ``Monday`` is ``0`` and ``Sunday`` is ``6``. + where Monday is day number 0. >>> import calendar >>> list(calendar.day_name) @@ -404,7 +404,7 @@ The :mod:`calendar` module exports the following data attributes: .. data:: day_abbr A sequence that represents the abbreviated days of the week in the current locale, - where ``Mon`` is ``0`` and ``Sun`` is ``6``. + where Mon is day number 0. >>> import calendar >>> list(calendar.day_abbr) From 983c6a9fadbb5fdab69874e0e0f187dbb96cd5cb Mon Sep 17 00:00:00 2001 From: Adam Turner <9087854+AA-Turner@users.noreply.github.com> Date: Wed, 25 Sep 2024 09:23:53 +0100 Subject: [PATCH 8/8] Apply suggestions from code review Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com> --- Doc/library/calendar.rst | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/Doc/library/calendar.rst b/Doc/library/calendar.rst index f44de699c8bb8f..eafc038d6cb722 100644 --- a/Doc/library/calendar.rst +++ b/Doc/library/calendar.rst @@ -441,8 +441,7 @@ The :mod:`calendar` module exports the following data attributes: >>> import calendar >>> list(calendar.month_name) - ['', 'January', 'February', 'March', 'April', 'May', 'June', - 'July', 'August', 'September', 'October', 'November', 'December'] + ['', 'January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'] .. data:: month_abbr @@ -453,8 +452,7 @@ The :mod:`calendar` module exports the following data attributes: >>> import calendar >>> list(calendar.month_abbr) - ['', 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', - 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'] + ['', 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'] .. data:: JANUARY FEBRUARY