Skip to content

Commit ee61f7d

Browse files
[3.11] GH-108202: Document calendar exceptions (GH-108398) (#108468)
Co-authored-by: Adam Turner <[email protected]>
1 parent ea77520 commit ee61f7d

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
@@ -417,6 +417,29 @@ The :mod:`calendar` module exports the following data attributes:
417417

418418
Aliases for day numbers, where ``MONDAY`` is ``0`` and ``SUNDAY`` is ``6``.
419419

420+
421+
The :mod:`calendar` module defines the following exceptions:
422+
423+
.. exception:: IllegalMonthError(month)
424+
425+
A subclass of :exc:`ValueError`,
426+
raised when the given month number is outside of the range 1-12 (inclusive).
427+
428+
.. attribute:: month
429+
430+
The invalid month number.
431+
432+
433+
.. exception:: IllegalWeekdayError(weekday)
434+
435+
A subclass of :exc:`ValueError`,
436+
raised when the given weekday number is outside of the range 0-6 (inclusive).
437+
438+
.. attribute:: weekday
439+
440+
The invalid weekday number.
441+
442+
420443
.. seealso::
421444

422445
Module :mod:`datetime`

0 commit comments

Comments
 (0)