https://github.com/python/cpython/commit/cf06f5905ff01927c5a357b293e16e191be7fe66 commit: cf06f5905ff01927c5a357b293e16e191be7fe66 branch: 3.12 author: Miss Islington (bot) <[email protected]> committer: AA-Turner <[email protected]> date: 2024-09-25T09:31:17Z summary:
[3.12] gh-123445: calendar: Improve descriptions for day and month attributes (GH-123483) (#124501) gh-123445: calendar: Improve descriptions for day and month attributes (GH-123483) (cherry picked from commit 8447c933da308939b06e33544ca9abc9fc46aa8b) Co-authored-by: Mat S <[email protected]> Co-authored-by: Adam Turner <[email protected]> Co-authored-by: Eric V. Smith <[email protected]> Co-authored-by: Hugo van Kemenade <[email protected]> files: M Doc/library/calendar.rst diff --git a/Doc/library/calendar.rst b/Doc/library/calendar.rst index 02d659f9569b1e..102bc2871799c5 100644 --- a/Doc/library/calendar.rst +++ b/Doc/library/calendar.rst @@ -393,13 +393,22 @@ The :mod:`calendar` module exports the following data attributes: .. data:: day_name - An array that represents the days of the week in the current locale. + A sequence that represents the days of the week in the current locale, + where Monday is day number 0. + + >>> import calendar + >>> list(calendar.day_name) + ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday'] .. data:: day_abbr - An array that represents the abbreviated days of the week in the current locale. + A sequence that represents the abbreviated days of the week in the current locale, + where Mon is day number 0. + >>> import calendar + >>> list(calendar.day_abbr) + ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'] .. data:: MONDAY TUESDAY @@ -426,17 +435,24 @@ The :mod:`calendar` module exports the following data attributes: .. data:: month_name - An array that represents the months of the year in the current locale. This + A sequence that represents the months of the year in the current locale. This follows normal convention of January being month number 1, so it has a length of 13 and ``month_name[0]`` is the empty string. + >>> import calendar + >>> list(calendar.month_name) + ['', 'January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'] + .. data:: month_abbr - An array that represents the abbreviated months of the year in the current + A sequence that represents the abbreviated months of the year in the current locale. This follows normal convention of January being month number 1, so it has a length of 13 and ``month_abbr[0]`` is the empty string. + >>> import calendar + >>> list(calendar.month_abbr) + ['', 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'] .. data:: JANUARY FEBRUARY _______________________________________________ Python-checkins mailing list -- [email protected] To unsubscribe send an email to [email protected] https://mail.python.org/mailman3/lists/python-checkins.python.org/ Member address: [email protected]
