]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
GH-108202: Document ``calendar`` exceptions (#108398)
authorAdam Turner <9087854+AA-Turner@users.noreply.github.com>
Fri, 25 Aug 2023 05:56:54 +0000 (06:56 +0100)
committerGitHub <noreply@github.com>
Fri, 25 Aug 2023 05:56:54 +0000 (23:56 -0600)
Doc/library/calendar.rst

index 07d04a1c7b582af34e071c2eead089bb835279e3..3c097f4cf7abd9608ce4f4f88cfdd0a42433e7fe 100644 (file)
@@ -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 outside of 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 outside of the range 0-6 (inclusive).
+
+   .. attribute:: weekday
+
+      The invalid weekday number.
+
+
 .. seealso::
 
    Module :mod:`datetime`