Skip to content

Commit 1350987

Browse files
authored
GH-108202: Document calendar exceptions (#108398)
1 parent ddf66b5 commit 1350987

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

Doc/library/calendar.rst

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -469,6 +469,29 @@ The :mod:`calendar` module exports the following data attributes:
469469

470470
Aliases for day numbers, where ``MONDAY`` is ``0`` and ``SUNDAY`` is ``6``.
471471

472+
473+
The :mod:`calendar` module defines the following exceptions:
474+
475+
.. exception:: IllegalMonthError(month)
476+
477+
A subclass of :exc:`ValueError`,
478+
raised when the given month number is outside of the range 1-12 (inclusive).
479+
480+
.. attribute:: month
481+
482+
The invalid month number.
483+
484+
485+
.. exception:: IllegalWeekdayError(weekday)
486+
487+
A subclass of :exc:`ValueError`,
488+
raised when the given weekday number is outside of the range 0-6 (inclusive).
489+
490+
.. attribute:: weekday
491+
492+
The invalid weekday number.
493+
494+
472495
.. seealso::
473496

474497
Module :mod:`datetime`

0 commit comments

Comments
 (0)