Skip to content

Commit

Permalink
pythonGH-108202: Document calendar exceptions (pythonGH-108398)
Browse files Browse the repository at this point in the history
(cherry picked from commit 1350987)

Co-authored-by: Adam Turner <[email protected]>
  • Loading branch information
AA-Turner authored and miss-islington committed Aug 25, 2023
1 parent ea77520 commit 3f6fc2a
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions Doc/library/calendar.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Expand Down

0 comments on commit 3f6fc2a

Please sign in to comment.