Skip to content

Commit 139f47f

Browse files
miss-islingtonm4t5AA-Turnerericvsmithhugovk
authored
[3.13] gh-123445: calendar: Improve descriptions for day and month attributes (GH-123483) (#124500)
gh-123445: calendar: Improve descriptions for day and month attributes (GH-123483) (cherry picked from commit 8447c93) 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]>
1 parent 5b7d4ce commit 139f47f

File tree

1 file changed

+20
-4
lines changed

1 file changed

+20
-4
lines changed

Doc/library/calendar.rst

+20-4
Original file line numberDiff line numberDiff line change
@@ -393,13 +393,22 @@ The :mod:`calendar` module exports the following data attributes:
393393

394394
.. data:: day_name
395395

396-
An array that represents the days of the week in the current locale.
396+
A sequence that represents the days of the week in the current locale,
397+
where Monday is day number 0.
398+
399+
>>> import calendar
400+
>>> list(calendar.day_name)
401+
['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday']
397402

398403

399404
.. data:: day_abbr
400405

401-
An array that represents the abbreviated days of the week in the current locale.
406+
A sequence that represents the abbreviated days of the week in the current locale,
407+
where Mon is day number 0.
402408

409+
>>> import calendar
410+
>>> list(calendar.day_abbr)
411+
['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']
403412

404413
.. data:: MONDAY
405414
TUESDAY
@@ -426,17 +435,24 @@ The :mod:`calendar` module exports the following data attributes:
426435

427436
.. data:: month_name
428437

429-
An array that represents the months of the year in the current locale. This
438+
A sequence that represents the months of the year in the current locale. This
430439
follows normal convention of January being month number 1, so it has a length of
431440
13 and ``month_name[0]`` is the empty string.
432441

442+
>>> import calendar
443+
>>> list(calendar.month_name)
444+
['', 'January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December']
445+
433446

434447
.. data:: month_abbr
435448

436-
An array that represents the abbreviated months of the year in the current
449+
A sequence that represents the abbreviated months of the year in the current
437450
locale. This follows normal convention of January being month number 1, so it
438451
has a length of 13 and ``month_abbr[0]`` is the empty string.
439452

453+
>>> import calendar
454+
>>> list(calendar.month_abbr)
455+
['', 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']
440456

441457
.. data:: JANUARY
442458
FEBRUARY

0 commit comments

Comments
 (0)