From 8133ed1ef22b9c84b849fd0d85cce805858e2dde Mon Sep 17 00:00:00 2001 From: "Erlend E. Aasland" Date: Tue, 7 Jan 2025 00:47:01 +0100 Subject: [PATCH 1/4] gh-108202: Document calendar.Calendar.firstweekday --- Doc/library/calendar.rst | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/Doc/library/calendar.rst b/Doc/library/calendar.rst index dadd301ebc795b..5b076dcc2a2e1b 100644 --- a/Doc/library/calendar.rst +++ b/Doc/library/calendar.rst @@ -38,15 +38,27 @@ interpreted as prescribed by the ISO 8601 standard. Year 0 is 1 BC, year -1 is itself. This is the job of subclasses. - :class:`Calendar` instances have the following methods: + :class:`Calendar` instances have the following methods and attributes: + + .. attribute:: firstweekday + + The first weekday as an integer (0--6). + + This property can also be set and read using + :meth:`~Calendar.setfirstweekday` and + :meth:`~Calendar.getfirstweekday` respectively. .. method:: getfirstweekday() - Return an :class:`int` for the current first weekday (0-6). + Return an :class:`int` for the current first weekday (0--6). + + Identical to the reading the :attr:`firstweekday` property. .. method:: setfirstweekday(firstweekday) - Set the first weekday to *firstweekday*, passed as an :class:`int` where Monday is 0 and Sunday is 6. + Set the first weekday to *firstweekday*, passed as an :class:`int` (0--6) + + Identical to the setting the :attr:`firstweekday` property. .. method:: iterweekdays() From 751d27c4a6ce4304e1c3a637b1f0a6bbb234e854 Mon Sep 17 00:00:00 2001 From: "Erlend E. Aasland" Date: Tue, 7 Jan 2025 00:56:57 +0100 Subject: [PATCH 2/4] minus the minus the --- 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 5b076dcc2a2e1b..ac90d3f154c844 100644 --- a/Doc/library/calendar.rst +++ b/Doc/library/calendar.rst @@ -52,13 +52,13 @@ interpreted as prescribed by the ISO 8601 standard. Year 0 is 1 BC, year -1 is Return an :class:`int` for the current first weekday (0--6). - Identical to the reading the :attr:`firstweekday` property. + Identical to reading the :attr:`firstweekday` property. .. method:: setfirstweekday(firstweekday) Set the first weekday to *firstweekday*, passed as an :class:`int` (0--6) - Identical to the setting the :attr:`firstweekday` property. + Identical to setting the :attr:`firstweekday` property. .. method:: iterweekdays() From 10a0235dd2291a4bf6ed88df905d415c7a2e3a20 Mon Sep 17 00:00:00 2001 From: "Erlend E. Aasland" Date: Tue, 7 Jan 2025 00:58:23 +0100 Subject: [PATCH 3/4] Fix links --- 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 ac90d3f154c844..c9c818df53f396 100644 --- a/Doc/library/calendar.rst +++ b/Doc/library/calendar.rst @@ -52,13 +52,13 @@ interpreted as prescribed by the ISO 8601 standard. Year 0 is 1 BC, year -1 is Return an :class:`int` for the current first weekday (0--6). - Identical to reading the :attr:`firstweekday` property. + Identical to reading the :attr:`~Calendar.firstweekday` property. .. method:: setfirstweekday(firstweekday) Set the first weekday to *firstweekday*, passed as an :class:`int` (0--6) - Identical to setting the :attr:`firstweekday` property. + Identical to setting the :attr:`~Calendar.firstweekday` property. .. method:: iterweekdays() From 8111779eb7b4f2355eef2fc3a2761c4a683abb59 Mon Sep 17 00:00:00 2001 From: "Erlend E. Aasland" Date: Tue, 7 Jan 2025 01:01:24 +0100 Subject: [PATCH 4/4] Fix reference in iterweekdays() --- 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 c9c818df53f396..f25930eb0d873e 100644 --- a/Doc/library/calendar.rst +++ b/Doc/library/calendar.rst @@ -64,7 +64,7 @@ interpreted as prescribed by the ISO 8601 standard. Year 0 is 1 BC, year -1 is Return an iterator for the week day numbers that will be used for one week. The first value from the iterator will be the same as the value of - the :attr:`firstweekday` property. + the :attr:`~Calendar.firstweekday` property. .. method:: itermonthdates(year, month)