From 902ff60a0c19dc9f21871160a15a72437f87099b Mon Sep 17 00:00:00 2001 From: Adam Turner <9087854+aa-turner@users.noreply.github.com> Date: Thu, 24 Aug 2023 04:12:21 +0100 Subject: [PATCH 1/3] Document ``calendar`` exceptions --- Doc/library/calendar.rst | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/Doc/library/calendar.rst b/Doc/library/calendar.rst index 07d04a1c7b582a..fa12c19275f20a 100644 --- a/Doc/library/calendar.rst +++ b/Doc/library/calendar.rst @@ -469,6 +469,29 @@ The :mod:`calendar` module exports the following data attributes: Aliases for day numbers, where ``MONDAY`` is ``0`` and ``SUNDAY`` is ``6``. + +The :mod:`calendar` module defines the following exceptions: + +.. exception:: IllegalMonthError(month) + + A subclass of :exc:`ValueError`, + raised when the given month number is outwith the range 1-12 (inclusive). + + .. attribute:: month + + The invalid month number. + + +.. exception:: IllegalWeekdayError(weekday) + + A subclass of :exc:`ValueError`, + raised when the given weekday number is outwith the range 0-6 (inclusive). + + .. attribute:: month + + The invalid weekday number. + + .. seealso:: Module :mod:`datetime` From 6f7fbb9a6decb8614b410c323f10b5412132b76b Mon Sep 17 00:00:00 2001 From: Adam Turner <9087854+aa-turner@users.noreply.github.com> Date: Thu, 24 Aug 2023 04:14:24 +0100 Subject: [PATCH 2/3] fixup! Document ``calendar`` exceptions --- 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 fa12c19275f20a..f925b2fe0a8ca3 100644 --- a/Doc/library/calendar.rst +++ b/Doc/library/calendar.rst @@ -487,7 +487,7 @@ The :mod:`calendar` module defines the following exceptions: A subclass of :exc:`ValueError`, raised when the given weekday number is outwith the range 0-6 (inclusive). - .. attribute:: month + .. attribute:: weekday The invalid weekday number. From e35240cfbfaa3670daec3a8d1360aee1af703b93 Mon Sep 17 00:00:00 2001 From: Adam Turner <9087854+aa-turner@users.noreply.github.com> Date: Fri, 25 Aug 2023 04:48:42 +0100 Subject: [PATCH 3/3] Be less Scottish --- 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 f925b2fe0a8ca3..3c097f4cf7abd9 100644 --- a/Doc/library/calendar.rst +++ b/Doc/library/calendar.rst @@ -475,7 +475,7 @@ The :mod:`calendar` module defines the following exceptions: .. exception:: IllegalMonthError(month) A subclass of :exc:`ValueError`, - raised when the given month number is outwith the range 1-12 (inclusive). + raised when the given month number is outside of the range 1-12 (inclusive). .. attribute:: month @@ -485,7 +485,7 @@ The :mod:`calendar` module defines the following exceptions: .. exception:: IllegalWeekdayError(weekday) A subclass of :exc:`ValueError`, - raised when the given weekday number is outwith the range 0-6 (inclusive). + raised when the given weekday number is outside of the range 0-6 (inclusive). .. attribute:: weekday