]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.11] GH-108202: Document ``calendar`` exceptions (GH-108398) (#108468)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Fri, 25 Aug 2023 06:06:34 +0000 (23:06 -0700)
committerGitHub <noreply@github.com>
Fri, 25 Aug 2023 06:06:34 +0000 (06:06 +0000)
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Doc/library/calendar.rst

index 66f59f0e2ced27515193bc6231467b7ce527145c..6460e6f0f4974515298bbd2aeef98d3c47833c7e 100644 (file)
@@ -417,6 +417,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`