[3.12] GH-108202: Document `calendar` exceptions (GH-108398) (#108467)

GH-108202: Document ``calendar`` exceptions (GH-108398)
(cherry picked from commit 135098743a)

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
This commit is contained in:
Miss Islington (bot) 2023-08-25 09:20:38 -07:00 committed by GitHub
parent 9a225d7d5b
commit c5448ab6d4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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`