summaryrefslogtreecommitdiffstats
path: root/Doc
diff options
context:
space:
mode:
authorAdam Turner <9087854+AA-Turner@users.noreply.github.com>2023-08-25 05:56:54 (GMT)
committerGitHub <noreply@github.com>2023-08-25 05:56:54 (GMT)
commit135098743a0fae0efbcd98e35458e5bc721702e9 (patch)
tree95646b73715d1865b268ee47f168a097235d6493 /Doc
parentddf66b54edea1ea59fdf8a496ed0b64e16424375 (diff)
downloadcpython-135098743a0fae0efbcd98e35458e5bc721702e9.zip
cpython-135098743a0fae0efbcd98e35458e5bc721702e9.tar.gz
cpython-135098743a0fae0efbcd98e35458e5bc721702e9.tar.bz2
GH-108202: Document ``calendar`` exceptions (#108398)
Diffstat (limited to 'Doc')
-rw-r--r--Doc/library/calendar.rst23
1 files changed, 23 insertions, 0 deletions
diff --git a/Doc/library/calendar.rst b/Doc/library/calendar.rst
index 07d04a1..3c097f4 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 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`