From ee61f7db3184110216b907002222ce10355026fa Mon Sep 17 00:00:00 2001 From: "Miss Islington (bot)" <31488909+miss-islington@users.noreply.github.com> Date: Thu, 24 Aug 2023 23:06:34 -0700 Subject: [PATCH] [3.11] GH-108202: Document ``calendar`` exceptions (GH-108398) (#108468) Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com> --- Doc/library/calendar.rst | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/Doc/library/calendar.rst b/Doc/library/calendar.rst index 66f59f0e2ced..6460e6f0f497 100644 --- a/Doc/library/calendar.rst +++ b/Doc/library/calendar.rst @@ -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` -- 2.47.3