From e46405e47a4465b0232610176f9b45b7c9f7d7b2 Mon Sep 17 00:00:00 2001 From: "Stan U." <89152624+StanFromIreland@users.noreply.github.com> Date: Tue, 3 Dec 2024 20:40:59 +0000 Subject: [PATCH 01/18] Document getfirstweekday and setfirstweekday --- Doc/library/calendar.rst | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Doc/library/calendar.rst b/Doc/library/calendar.rst index eafc038d6cb722..7493cf15454586 100644 --- a/Doc/library/calendar.rst +++ b/Doc/library/calendar.rst @@ -40,6 +40,14 @@ interpreted as prescribed by the ISO 8601 standard. Year 0 is 1 BC, year -1 is :class:`Calendar` instances have the following methods: + .. method:: getfirstweekday() + + Return an int for the current first weekday (0--6). + + .. method:: setfirstweekday(firstweekday) + + Allows you to change the first weekday by setting `firstweekday` to an int (0--6). + .. method:: iterweekdays() Return an iterator for the week day numbers that will be used for one From de386b91f69dfd1b81c3bc210f5b6227f814d5a7 Mon Sep 17 00:00:00 2001 From: "Stan U." <89152624+StanFromIreland@users.noreply.github.com> Date: Wed, 4 Dec 2024 16:03:27 +0000 Subject: [PATCH 02/18] Update Doc/library/calendar.rst Co-authored-by: Peter Bierma --- Doc/library/calendar.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Doc/library/calendar.rst b/Doc/library/calendar.rst index 7493cf15454586..fc4160852c4135 100644 --- a/Doc/library/calendar.rst +++ b/Doc/library/calendar.rst @@ -42,7 +42,7 @@ interpreted as prescribed by the ISO 8601 standard. Year 0 is 1 BC, year -1 is .. method:: getfirstweekday() - Return an int for the current first weekday (0--6). + Return an :class:`int` for the current first weekday (0-6). .. method:: setfirstweekday(firstweekday) From 3e1edc4d420182f8097c2863a1ed38ac374f031b Mon Sep 17 00:00:00 2001 From: "Stan U." <89152624+StanFromIreland@users.noreply.github.com> Date: Wed, 4 Dec 2024 16:05:17 +0000 Subject: [PATCH 03/18] Update calendar.rst --- Doc/library/calendar.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Doc/library/calendar.rst b/Doc/library/calendar.rst index fc4160852c4135..f51af88980324d 100644 --- a/Doc/library/calendar.rst +++ b/Doc/library/calendar.rst @@ -46,7 +46,7 @@ interpreted as prescribed by the ISO 8601 standard. Year 0 is 1 BC, year -1 is .. method:: setfirstweekday(firstweekday) - Allows you to change the first weekday by setting `firstweekday` to an int (0--6). + Change the first weekday by setting ``firstweekday`` to an :class:`int` (0–6). .. method:: iterweekdays() From ee2a8a2a5e7c6726e460ef86fe5f5b24c4102aaa Mon Sep 17 00:00:00 2001 From: "Stan U." <89152624+StanFromIreland@users.noreply.github.com> Date: Wed, 4 Dec 2024 16:22:39 +0000 Subject: [PATCH 04/18] Update calendar.rst --- Doc/library/calendar.rst | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/Doc/library/calendar.rst b/Doc/library/calendar.rst index f51af88980324d..57cf89cb26508e 100644 --- a/Doc/library/calendar.rst +++ b/Doc/library/calendar.rst @@ -14,10 +14,10 @@ This module allows you to output calendars like the Unix :program:`cal` program, and provides additional useful functions related to the calendar. By default, these calendars have Monday as the first day of the week, and Sunday as the last -(the European convention). Use :func:`setfirstweekday` to set the first day of -the week to Sunday (6) or to any other weekday. Parameters that specify dates -are given as integers. For related -functionality, see also the :mod:`datetime` and :mod:`time` modules. +(the European convention). Use :func:`setfirstweekday` to set the ``firstweekday`` +to Sunday (6) or to any other weekday. Parameters that specify dates +are given as integers. For related functionality, see also the :mod:`datetime` +and :mod:`time` modules. The functions and classes defined in this module use an idealized calendar, the current Gregorian calendar extended indefinitely @@ -30,7 +30,7 @@ interpreted as prescribed by the ISO 8601 standard. Year 0 is 1 BC, year -1 is .. class:: Calendar(firstweekday=0) - Creates a :class:`Calendar` object. *firstweekday* is an integer specifying the + Creates a :class:`Calendar` object. ``firstweekday`` is an integer specifying the first day of the week. :const:`MONDAY` is ``0`` (the default), :const:`SUNDAY` is ``6``. A :class:`Calendar` object provides several methods that can be used for @@ -399,10 +399,16 @@ For simple text calendars this module provides the following functions. The :mod:`calendar` module exports the following data attributes: +.. data:: firstweekday + + An :class:int (0-6) representing the current setting for the first weekday. + The default is 0, which corresponds to Monday. + + .. data:: day_name A sequence that represents the days of the week in the current locale, - where Monday is day number 0. + where Monday is day number ``0``. >>> import calendar >>> list(calendar.day_name) @@ -412,7 +418,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 day number 0. + where Mon is day number ``0``. >>> import calendar >>> list(calendar.day_abbr) From a0a7ba076c8ae2b50a834c9947f59a83f1fd41e6 Mon Sep 17 00:00:00 2001 From: "Stan U." <89152624+StanFromIreland@users.noreply.github.com> Date: Wed, 4 Dec 2024 16:26:52 +0000 Subject: [PATCH 05/18] Remove trailing whitespace --- 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 57cf89cb26508e..544224636c4810 100644 --- a/Doc/library/calendar.rst +++ b/Doc/library/calendar.rst @@ -14,9 +14,9 @@ This module allows you to output calendars like the Unix :program:`cal` program, and provides additional useful functions related to the calendar. By default, these calendars have Monday as the first day of the week, and Sunday as the last -(the European convention). Use :func:`setfirstweekday` to set the ``firstweekday`` +(the European convention). Use :func:`setfirstweekday` to set the ``firstweekday`` to Sunday (6) or to any other weekday. Parameters that specify dates -are given as integers. For related functionality, see also the :mod:`datetime` +are given as integers. For related functionality, see also the :mod:`datetime` and :mod:`time` modules. The functions and classes defined in this module @@ -30,7 +30,7 @@ interpreted as prescribed by the ISO 8601 standard. Year 0 is 1 BC, year -1 is .. class:: Calendar(firstweekday=0) - Creates a :class:`Calendar` object. ``firstweekday`` is an integer specifying the + Creates a :class:`Calendar` object. ```` is an integer specifying the first day of the week. :const:`MONDAY` is ``0`` (the default), :const:`SUNDAY` is ``6``. A :class:`Calendar` object provides several methods that can be used for @@ -401,7 +401,7 @@ The :mod:`calendar` module exports the following data attributes: .. data:: firstweekday - An :class:int (0-6) representing the current setting for the first weekday. + An :class:int (0-6) representing the current setting for the first weekday. The default is 0, which corresponds to Monday. From ffbc5673a572e3a16127941bad451a3af8910d6a Mon Sep 17 00:00:00 2001 From: "Stan U." <89152624+StanFromIreland@users.noreply.github.com> Date: Wed, 4 Dec 2024 16:27:49 +0000 Subject: [PATCH 06/18] Update calendar.rst --- Doc/library/calendar.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Doc/library/calendar.rst b/Doc/library/calendar.rst index 544224636c4810..5a6889fb7914de 100644 --- a/Doc/library/calendar.rst +++ b/Doc/library/calendar.rst @@ -30,7 +30,7 @@ interpreted as prescribed by the ISO 8601 standard. Year 0 is 1 BC, year -1 is .. class:: Calendar(firstweekday=0) - Creates a :class:`Calendar` object. ```` is an integer specifying the + Creates a :class:`Calendar` object. ``firstweekday`` is an integer specifying the first day of the week. :const:`MONDAY` is ``0`` (the default), :const:`SUNDAY` is ``6``. A :class:`Calendar` object provides several methods that can be used for From 86a39c479992898b74d8614260f9fcdeaba74a1b Mon Sep 17 00:00:00 2001 From: "Stan U." <89152624+StanFromIreland@users.noreply.github.com> Date: Wed, 4 Dec 2024 16:29:55 +0000 Subject: [PATCH 07/18] Update calendar.rst --- Doc/library/calendar.rst | 1 - 1 file changed, 1 deletion(-) diff --git a/Doc/library/calendar.rst b/Doc/library/calendar.rst index 5a6889fb7914de..30699db1ac132e 100644 --- a/Doc/library/calendar.rst +++ b/Doc/library/calendar.rst @@ -403,7 +403,6 @@ The :mod:`calendar` module exports the following data attributes: An :class:int (0-6) representing the current setting for the first weekday. The default is 0, which corresponds to Monday. - .. data:: day_name From 9096b51037678850dd603e9960a87e0e83dec77b Mon Sep 17 00:00:00 2001 From: "Stan U." <89152624+StanFromIreland@users.noreply.github.com> Date: Wed, 4 Dec 2024 16:33:57 +0000 Subject: [PATCH 08/18] Update calendar.rst --- Doc/library/calendar.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Doc/library/calendar.rst b/Doc/library/calendar.rst index 30699db1ac132e..d7aeb846faa5c3 100644 --- a/Doc/library/calendar.rst +++ b/Doc/library/calendar.rst @@ -401,7 +401,7 @@ The :mod:`calendar` module exports the following data attributes: .. data:: firstweekday - An :class:int (0-6) representing the current setting for the first weekday. + An :class:`int` (0-6) representing the current setting for the first weekday. The default is 0, which corresponds to Monday. .. data:: day_name From 692a29c007bae916ba8df754240075c7d1e8c06f Mon Sep 17 00:00:00 2001 From: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com> Date: Tue, 17 Dec 2024 16:36:49 +0000 Subject: [PATCH 09/18] Update Doc/library/calendar.rst Co-authored-by: Pieter Eendebak --- Doc/library/calendar.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Doc/library/calendar.rst b/Doc/library/calendar.rst index d7aeb846faa5c3..3e6580dcf14115 100644 --- a/Doc/library/calendar.rst +++ b/Doc/library/calendar.rst @@ -417,7 +417,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 day number ``0``. + where Monday is day number ``0``. >>> import calendar >>> list(calendar.day_abbr) From 342c396a3835cd685bd7200f6c4026c3976989a3 Mon Sep 17 00:00:00 2001 From: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com> Date: Tue, 17 Dec 2024 16:41:33 +0000 Subject: [PATCH 10/18] Update calendar.rst --- Doc/library/calendar.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/Doc/library/calendar.rst b/Doc/library/calendar.rst index 3e6580dcf14115..fa1bcfb52ed04d 100644 --- a/Doc/library/calendar.rst +++ b/Doc/library/calendar.rst @@ -400,6 +400,7 @@ For simple text calendars this module provides the following functions. The :mod:`calendar` module exports the following data attributes: .. data:: firstweekday + :no-index: An :class:`int` (0-6) representing the current setting for the first weekday. The default is 0, which corresponds to Monday. From a76f3623b4a77cfa4a935e9540b821cd81a5c0e3 Mon Sep 17 00:00:00 2001 From: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com> Date: Sat, 4 Jan 2025 13:56:52 +0000 Subject: [PATCH 11/18] Update calendar.rst --- Doc/library/calendar.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Doc/library/calendar.rst b/Doc/library/calendar.rst index fa1bcfb52ed04d..f39a3768a1658a 100644 --- a/Doc/library/calendar.rst +++ b/Doc/library/calendar.rst @@ -30,7 +30,7 @@ interpreted as prescribed by the ISO 8601 standard. Year 0 is 1 BC, year -1 is .. class:: Calendar(firstweekday=0) - Creates a :class:`Calendar` object. ``firstweekday`` is an integer specifying the + Creates a :class:`Calendar` object. *firstweekday* is an integer specifying the first day of the week. :const:`MONDAY` is ``0`` (the default), :const:`SUNDAY` is ``6``. A :class:`Calendar` object provides several methods that can be used for From 89fb5fdf7230d95c46f9d91ea93c53756d729980 Mon Sep 17 00:00:00 2001 From: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com> Date: Sun, 5 Jan 2025 11:12:31 +0000 Subject: [PATCH 12/18] Update calendar.rst --- 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 f39a3768a1658a..b5da6f43142a9b 100644 --- a/Doc/library/calendar.rst +++ b/Doc/library/calendar.rst @@ -14,7 +14,7 @@ This module allows you to output calendars like the Unix :program:`cal` program, and provides additional useful functions related to the calendar. By default, these calendars have Monday as the first day of the week, and Sunday as the last -(the European convention). Use :func:`setfirstweekday` to set the ``firstweekday`` +(the European convention). Use :func:`setfirstweekday` to set the :attr:`firstweekday` to Sunday (6) or to any other weekday. Parameters that specify dates are given as integers. For related functionality, see also the :mod:`datetime` and :mod:`time` modules. @@ -46,7 +46,7 @@ interpreted as prescribed by the ISO 8601 standard. Year 0 is 1 BC, year -1 is .. method:: setfirstweekday(firstweekday) - Change the first weekday by setting ``firstweekday`` to an :class:`int` (0–6). + Change the first weekday by setting *firstweekday* to an :class:`int` (0–6). .. method:: iterweekdays() From 156c4180af402dffd47994e8e2869be29e0c339d Mon Sep 17 00:00:00 2001 From: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com> Date: Mon, 6 Jan 2025 17:52:01 +0000 Subject: [PATCH 13/18] Update Doc/library/calendar.rst Co-authored-by: Erlend E. Aasland --- Doc/library/calendar.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Doc/library/calendar.rst b/Doc/library/calendar.rst index b5da6f43142a9b..9c789dd2e24683 100644 --- a/Doc/library/calendar.rst +++ b/Doc/library/calendar.rst @@ -46,7 +46,7 @@ interpreted as prescribed by the ISO 8601 standard. Year 0 is 1 BC, year -1 is .. method:: setfirstweekday(firstweekday) - Change the first weekday by setting *firstweekday* to an :class:`int` (0–6). + Set the first weekday to *firstweekday*, passed as an :class:`int` where Monday is 0 and Sunday is 6. .. method:: iterweekdays() From ab7cba5be0dce24551e4f16b609247934f07be2e Mon Sep 17 00:00:00 2001 From: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com> Date: Mon, 6 Jan 2025 18:04:27 +0000 Subject: [PATCH 14/18] Update Doc/library/calendar.rst Co-authored-by: Erlend E. Aasland --- Doc/library/calendar.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Doc/library/calendar.rst b/Doc/library/calendar.rst index 9c789dd2e24683..e85a5ab33c3d2e 100644 --- a/Doc/library/calendar.rst +++ b/Doc/library/calendar.rst @@ -408,7 +408,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 day number ``0``. + where Monday is day number 0. >>> import calendar >>> list(calendar.day_name) From 4e587c82d72b5edaeddf6f6b05c4df9c43fce04b Mon Sep 17 00:00:00 2001 From: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com> Date: Mon, 6 Jan 2025 22:16:47 +0000 Subject: [PATCH 15/18] Update Doc/library/calendar.rst Co-authored-by: Erlend E. Aasland --- Doc/library/calendar.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Doc/library/calendar.rst b/Doc/library/calendar.rst index e85a5ab33c3d2e..2843b6426acaa7 100644 --- a/Doc/library/calendar.rst +++ b/Doc/library/calendar.rst @@ -418,7 +418,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 Monday is day number ``0``. + where Mon is day number 0. >>> import calendar >>> list(calendar.day_abbr) From 95f9fae600fca2596eba684279cf30e5ee8e15d0 Mon Sep 17 00:00:00 2001 From: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com> Date: Mon, 6 Jan 2025 22:18:09 +0000 Subject: [PATCH 16/18] Update calendar.rst --- 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 2843b6426acaa7..ab17877f171a8a 100644 --- a/Doc/library/calendar.rst +++ b/Doc/library/calendar.rst @@ -14,8 +14,8 @@ This module allows you to output calendars like the Unix :program:`cal` program, and provides additional useful functions related to the calendar. By default, these calendars have Monday as the first day of the week, and Sunday as the last -(the European convention). Use :func:`setfirstweekday` to set the :attr:`firstweekday` -to Sunday (6) or to any other weekday. Parameters that specify dates +(the European convention). Use :func:`setfirstweekday` to set the first day of +the week to Sunday (6) or to any other weekday. Parameters that specify dates are given as integers. For related functionality, see also the :mod:`datetime` and :mod:`time` modules. From 67201bed8c91b79a69c56e8eba52fdd861341cbb Mon Sep 17 00:00:00 2001 From: "Erlend E. Aasland" Date: Mon, 6 Jan 2025 23:35:13 +0100 Subject: [PATCH 17/18] Address review --- 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 ab17877f171a8a..a2d4f1f1e42e12 100644 --- a/Doc/library/calendar.rst +++ b/Doc/library/calendar.rst @@ -16,8 +16,8 @@ and provides additional useful functions related to the calendar. By default, these calendars have Monday as the first day of the week, and Sunday as the last (the European convention). Use :func:`setfirstweekday` to set the first day of the week to Sunday (6) or to any other weekday. Parameters that specify dates -are given as integers. For related functionality, see also the :mod:`datetime` -and :mod:`time` modules. +are given as integers. For related +functionality, see also the :mod:`datetime` and :mod:`time` modules. The functions and classes defined in this module use an idealized calendar, the current Gregorian calendar extended indefinitely From bc42d03bb906df178ebd23ee004b2cbb330d4fd2 Mon Sep 17 00:00:00 2001 From: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com> Date: Mon, 6 Jan 2025 22:55:26 +0000 Subject: [PATCH 18/18] Update calendar.rst --- Doc/library/calendar.rst | 6 ------ 1 file changed, 6 deletions(-) diff --git a/Doc/library/calendar.rst b/Doc/library/calendar.rst index a2d4f1f1e42e12..d54e0f2c5f0ad8 100644 --- a/Doc/library/calendar.rst +++ b/Doc/library/calendar.rst @@ -399,12 +399,6 @@ For simple text calendars this module provides the following functions. The :mod:`calendar` module exports the following data attributes: -.. data:: firstweekday - :no-index: - - An :class:`int` (0-6) representing the current setting for the first weekday. - The default is 0, which corresponds to Monday. - .. data:: day_name A sequence that represents the days of the week in the current locale,